InsuBusiness.cs 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777
  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. public InsuBusiness()
  39. {
  40. Global.curEvt.path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
  41. ComputerInfo comp = new ComputerInfo();
  42. Global.curEvt.mac = comp.GetMAC();
  43. Global.curEvt.ip = comp.GetIP();
  44. Global.pat.insuplc_admdvs = ""; //如果是NULL中心会报错
  45. }
  46. private int parseInparam(string inParam,out string errMsg)
  47. {
  48. errMsg = "";
  49. try
  50. {
  51. joInParam = JObject.Parse(inParam);
  52. jaSession = JArray.Parse(JsonHelper.getDestValue(joInParam, "session"));
  53. Global.curEvt.jaSession = jaSession;
  54. jaParams = JArray.Parse(JsonHelper.getDestValue(joInParam, "params"));
  55. joParam = JObject.FromObject(jaParams[0]);
  56. joInterface = JObject.Parse(JsonHelper.getDestValue(joInParam, "interfaceinfo"));
  57. businessType = JsonHelper.getDestValue(joInParam, "businessType");
  58. if ((businessType == "M6") || (businessType == "M6C") || (businessType == "M6Confirm"))
  59. {
  60. Environment.CurrentDirectory = @"D:\HttpServerAPI\bin\libs";
  61. }
  62. return 0;
  63. }
  64. catch (Exception ex)
  65. {
  66. errMsg = "parseInparam 解析入参异常:" + errMsg;
  67. return -1;
  68. }
  69. }
  70. /// <summary>
  71. /// 签到
  72. /// </summary>
  73. /// <param name="InParam"></param>
  74. /// <returns></returns>
  75. public string Init(string InParam)
  76. {
  77. string errMsg, rtnResult ="";
  78. JObject joRtn = new JObject();
  79. try
  80. {
  81. if (hBus.initEnvironment(InParam, out errMsg) != 0)
  82. {
  83. return JsonHelper.setExceptionJson(-100, "initEnvironment 失败", errMsg).ToString();
  84. }
  85. else
  86. {
  87. if (mIS.isSigned(ref Global.curEvt.signno) != true)
  88. {
  89. if (businessType != "BasicData")//如果是打开数据对照界面不调用初始化
  90. {
  91. //签到
  92. if (cBus.signIn(out joRtn) != 0)
  93. {
  94. rtnResult = JsonHelper.setExceptionJson(-1, "签到异常", (string)joRtn["err_msg"]).ToString();
  95. return rtnResult;
  96. }
  97. else
  98. {
  99. Global.curEvt.signno = JsonHelper.getDestValue(joRtn, "output.signinoutb.sign_no");
  100. //插入签到表
  101. if (mIS.saveSignRecord(Global.curEvt.signno, out errMsg) != 0)
  102. {
  103. rtnResult = JsonHelper.setIrisReturnValue(0, "中心签到成功但插入签到表失败:" + errMsg, null).ToString();
  104. }
  105. else
  106. {
  107. rtnResult = JsonHelper.setIrisReturnValue(0, "签到成功", joRtn).ToString();
  108. }
  109. }
  110. }
  111. else
  112. {
  113. Global.curEvt.signno = "ABC123";
  114. rtnResult = JsonHelper.setIrisReturnValue(0, "初始化成功(医保对照不初始化)!", null).ToString();
  115. }
  116. }
  117. else
  118. {
  119. rtnResult = JsonHelper.setIrisReturnValue(0, "初始化成功!", null).ToString();
  120. }
  121. return rtnResult;
  122. }
  123. }
  124. catch (Exception ex)
  125. {
  126. rtnResult = JsonHelper.setExceptionJson(-100, "Init 异常", ex.Message).ToString();
  127. return rtnResult;
  128. }
  129. finally
  130. {
  131. Global.writeLog("初始化结果:" + rtnResult);
  132. }
  133. }
  134. /// <summary>
  135. /// 初始化
  136. /// </summary>
  137. /// <param name="inParam"></param>
  138. /// <param name="outParam"></param>
  139. /// <returns></returns>
  140. private int init(string inParam, out string outParam)
  141. {
  142. string errMsg;
  143. outParam = "";
  144. try
  145. {
  146. //BS架构调用方式问题,每次调用都需要重新初始化
  147. JObject joInitRtn = JObject.Parse(Init(inParam));
  148. if (JsonHelper.parseIrisRtnValue(joInitRtn, out errMsg) != 0)
  149. {
  150. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)", errMsg).ToString();
  151. return -1;
  152. }
  153. else
  154. {
  155. return 0;
  156. }
  157. }
  158. catch (Exception ex)
  159. {
  160. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)异常", ex.Message).ToString();
  161. return -1;
  162. }
  163. }
  164. /// <summary>
  165. /// 获取患者信息
  166. /// </summary>
  167. /// <param name="InParam"></param>
  168. /// <returns></returns>
  169. public string GetPatientInfo(string InParam)
  170. {
  171. Global.writeLog("GetPatientInfo入参:" + JsonHelper.Compress(InParam));
  172. //设置返回值,错误信息
  173. int errCode;
  174. string errMsg, rtnResult = "",outParam;
  175. //BS架构调用方式问题,每次调用都需要重新初始化
  176. if (init(InParam,out outParam)!= 0)
  177. {
  178. rtnResult = outParam;
  179. return rtnResult;
  180. }
  181. JObject joInParam = JObject.Parse(InParam);
  182. string businessType = JsonHelper.getDestValue(joInParam,"businessType");
  183. try
  184. {
  185. switch (businessType)
  186. {
  187. case "M1"://门诊读卡
  188. {
  189. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  190. if (hBus.readCard(out outParam) != 0)
  191. {
  192. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  193. }
  194. else
  195. {
  196. //展示患者信息界面
  197. if (hBus.showPatInfo(outParam, out outParam) != 0)
  198. {
  199. rtnResult = outParam;
  200. }
  201. else
  202. {
  203. rtnResult = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(outParam)).ToString();
  204. }
  205. }
  206. break;
  207. }
  208. case "Z1"://住院读卡
  209. {
  210. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  211. if (hBus.readCard(out outParam) != 0)
  212. {
  213. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  214. }
  215. else
  216. {
  217. string patInfo = outParam;
  218. //展示患者信息界面
  219. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  220. {
  221. rtnResult = outParam;
  222. }
  223. else
  224. {
  225. rtnResult = JsonHelper.setIrisReturnValue(0,"",JObject.Parse(outParam)).ToString();
  226. }
  227. }
  228. break;
  229. }
  230. }
  231. return rtnResult;
  232. }
  233. catch (Exception ex)
  234. {
  235. rtnResult = JsonHelper.setIrisReturnValue(-1 , "GetPatientInfo发生异常;" + ex.Message,null).ToString();
  236. return rtnResult;
  237. }
  238. finally
  239. {
  240. Global.writeLog("GetPatientInfo出参:" + JsonHelper.Compress(rtnResult));
  241. }
  242. }
  243. /// <summary>
  244. /// 登记
  245. /// </summary>
  246. /// <param name="InParam"></param>
  247. /// <returns></returns>
  248. public string Register(string InParam)
  249. {
  250. Global.writeLog("Register 入参:" + JsonHelper.Compress(InParam));
  251. //设置返回值,错误信息
  252. string errMsg, rtnResult = "", outParam;
  253. try
  254. {
  255. //解析入参
  256. if (parseInparam(InParam, out errMsg) != 0)
  257. {
  258. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  259. return rtnResult;
  260. }
  261. //BS架构调用方式问题,每次调用都需要重新初始化
  262. if (init(InParam, out outParam) != 0)
  263. {
  264. rtnResult = outParam;
  265. return rtnResult;
  266. }
  267. //获取pat
  268. hBus.GetRegPatInfo(businessType, joInParam, out Global.pat);
  269. switch (businessType)
  270. {
  271. case "M2"://门诊登记
  272. {
  273. string patInfo = "";
  274. errMsg = showPatientInfo(out patInfo, out outParam);
  275. if (!errMsg.Equals("0"))
  276. {
  277. return errMsg;
  278. }
  279. Global.writeLog("获取到病人信息:" + patInfo);
  280. JObject reg = JObject.Parse(patInfo);
  281. this.OutpatientReg(reg,patInfo);
  282. break;
  283. }
  284. case "M2C"://门诊登记撤销
  285. {
  286. break;
  287. }
  288. case "Z0"://住院修改
  289. {
  290. break;
  291. }
  292. case "Z2"://入院登记
  293. {
  294. Global.writeLog(Global.pat.insuType);
  295. string regInParam = "";
  296. //显示登记面板
  297. if (hBus.showInPatRegisterForm( out regInParam) == 0)
  298. {
  299. Global.writeLog(regInParam);
  300. JObject joRegIn_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2401", regInParam));
  301. JObject joRegIn = JObject.Parse(JsonHelper.setCenterInpar("2401", regInParam));
  302. //上传给中心
  303. JObject joRegOut = invoker.invokeCenterService("2401", joRegIn);
  304. //将中心返回的结果返回HIS,调用HIS服务进行保存
  305. if (JsonHelper.parseCenterRtnValue(joRegOut,out errMsg) == 0)
  306. {
  307. joRegOut.Add("validflag",1);
  308. joRegOut.Add("regstate", 1);
  309. joRegOut.Add("type", 1);
  310. Global.pat.mdtrtID = JsonHelper.getDestValue(joRegOut, "output.result.mdtrt_id");
  311. //插入患者本次就诊用的参保信息
  312. if (hBus.insertPatCurInsuInfo(JsonHelper.getDestValue(joParam, "patientInfo"), out outParam) != 0)
  313. {
  314. if (DialogResult.Yes == MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
  315. {
  316. }
  317. else
  318. {
  319. rtnResult = JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!", outParam).ToString();
  320. return rtnResult;
  321. }
  322. }
  323. //插入医保平台
  324. if (mIS.saveInpatRegisterInfo(joRegIn_plain, joRegOut, out outParam) != 0)
  325. {
  326. rtnResult = JsonHelper.setExceptionJson(-1, "云平台保存登记信息", outParam).ToString();
  327. return rtnResult;
  328. }
  329. //返回登记信息,插入HIS
  330. if (hIS.returnRegisterInfo(joRegIn_plain, joRegOut, out outParam) != 0)
  331. {
  332. rtnResult = JsonHelper.setExceptionJson(-1, "HIS平台保存登记信息", outParam).ToString();
  333. return rtnResult;
  334. }
  335. else
  336. {
  337. rtnResult = JsonHelper.setIrisReturnValue(0, "登记成功", null).ToString();
  338. return rtnResult;
  339. }
  340. }
  341. else
  342. {
  343. rtnResult = JsonHelper.setExceptionJson(-1, "展示登记界面", errMsg).ToString();
  344. return rtnResult;
  345. }
  346. }
  347. else
  348. {
  349. rtnResult = JsonHelper.setExceptionJson(-1, "展示登记界面", regInParam).ToString();
  350. return rtnResult;
  351. }
  352. }
  353. case "Z2C"://入院登记取消
  354. {
  355. //if (DialogResult.Yes == MessageBox.Show("即将进行取消中心医保登记,确定继续吗?", " 询问? ", MessageBoxButtons.YesNo))
  356. //{
  357. //}
  358. //else
  359. //{
  360. // rtnResult = JsonHelper.setExceptionJson(-1, "收费员撤销取消登记操作!", outParam).ToString();
  361. // return rtnResult;
  362. //}
  363. //取消中心登记
  364. if (cBus.cancleRegister("2404", out outParam) != 0)
  365. {
  366. //如果医保中心没有HIS所传的医保登记信息则默认撤销HIS登记信息
  367. int i = outParam.IndexOf("不存在有效的就诊登记信息");
  368. if (i != 0)
  369. {
  370. if (DialogResult.Yes != MessageBox.Show("医保中心提示:" + outParam+ ",是否强制撤销HIS医保登记信息?", "提示", MessageBoxButtons.YesNo))
  371. {
  372. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记失败,", outParam).ToString();
  373. return rtnResult;
  374. }
  375. }
  376. }
  377. //取消医保平台登记
  378. if (mIS.cancleRegister(1, out outParam) != 0)
  379. {
  380. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记成功,但云医保平台取消失败,", outParam).ToString();
  381. return rtnResult;
  382. }
  383. //取消HIS 登记
  384. if (hIS.cancleRegister( out outParam) != 0)
  385. {
  386. rtnResult = JsonHelper.setExceptionJson(-1, "中心和云医保平台取消登记成功,但HIS取消失败,", outParam).ToString();
  387. return rtnResult;
  388. }
  389. else
  390. {
  391. //CM 20230602 删除医保平台医保费用明细上传表数据
  392. mIS.deleteFee(out errMsg);
  393. rtnResult = JsonHelper.setIrisReturnValue(0, "取消医保登记成功", null).ToString();
  394. return rtnResult;
  395. }
  396. }
  397. case "Z6"://出院登记
  398. {
  399. break;
  400. }
  401. case "Z6C"://出院登记取消
  402. {
  403. if (cBus.cancleRegister("2405", out errMsg) != 0)
  404. {
  405. rtnResult = JsonHelper.setExceptionJson(-1, "取消出院登记", errMsg).ToString();
  406. return rtnResult;
  407. }
  408. else
  409. {
  410. rtnResult = JsonHelper.setIrisReturnValue(0, "取消出院登记成功", null).ToString();
  411. return rtnResult;
  412. }
  413. break;
  414. }
  415. default:
  416. {
  417. rtnResult = JsonHelper.setExceptionJson(-1, "Register 交易", "传入的业务编码不对!").ToString();
  418. return rtnResult;
  419. }
  420. }
  421. }
  422. catch (Exception ex)
  423. {
  424. rtnResult = JsonHelper.setIrisReturnValue(-1, "Register 发生异常;" + ex.Message, null).ToString();
  425. return rtnResult;
  426. }
  427. finally
  428. {
  429. Global.writeLog("Register 出参:" + JsonHelper.Compress(rtnResult));
  430. }
  431. return "";
  432. }
  433. /// <summary>
  434. /// 费用上传
  435. /// </summary>
  436. /// <param name="InParam"></param>
  437. /// <returns></returns>
  438. public string FeeUpload(string InParam)
  439. {
  440. Global.writeLog("FeeUpload 入参:" + JsonHelper.Compress(InParam));
  441. //设置返回值,错误信息
  442. int errCode;
  443. string errMsg, rtnResult = "", outParam;
  444. try
  445. {
  446. //解析入参
  447. if (parseInparam(InParam, out errMsg) != 0)
  448. {
  449. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  450. return rtnResult;
  451. }
  452. //BS架构调用方式问题,每次调用都需要重新初始化
  453. if (init(InParam, out outParam) != 0)
  454. {
  455. rtnResult = outParam;
  456. return rtnResult;
  457. }
  458. //获取pat
  459. hBus.GetFeeHisInfo(businessType, joInParam, out Global.pat);
  460. switch (businessType)
  461. {
  462. case "M3"://门诊费用上传
  463. {
  464. break;
  465. }
  466. case "M3C"://门诊费用撤销
  467. {
  468. break;
  469. }
  470. case "Z3"://入院费用上传
  471. {
  472. //从医保平台获取患者详细的医保登记信息
  473. if (mIS.queryRegisterInfo(1, out outParam) != 0)
  474. {
  475. rtnResult = JsonHelper.setExceptionJson(-1, "查询患者云平台登记信息", outParam).ToString();
  476. return rtnResult;
  477. }
  478. JObject joReg = JObject.Parse(outParam);
  479. Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
  480. Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
  481. //先取消中心费用传送
  482. cBus.cancleFeeUpload("2302", out errMsg);
  483. //再删除医保传送表的数据
  484. mIS.deleteFee(out errMsg);
  485. #region【住院费用上传前调用3101事前服务】
  486. ////事前分析
  487. if (Global.curEvt.ext.isOpenAnalysis)
  488. {
  489. if (hBus.PreAnalysis("4", "", out errMsg) != 0)
  490. {
  491. rtnResult = JsonHelper.setExceptionJson(-1, "事前分析", errMsg).ToString();
  492. return rtnResult;
  493. }
  494. }
  495. }
  496. */
  497. #endregion
  498. //开始进行费用传送
  499. //调用HIS费用查询信息
  500. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  501. {
  502. rtnResult = JsonHelper.setExceptionJson(-1, "获取HIS费用", outParam).ToString();
  503. return rtnResult;
  504. }
  505. //调用医保平台转换
  506. JObject joHisFee = JObject.Parse(outParam);
  507. if (mIS.convertHisFeeWithInsuCode(joHisFee,out outParam) != 0)
  508. {
  509. rtnResult = JsonHelper.setExceptionJson(-1, "转换HIS费用", outParam).ToString();
  510. return rtnResult;
  511. }
  512. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  513. //按指定条数分割后上传,保存,更新
  514. if (hBus.uploadFeeToCenter("2301",10, jaFeeDetail, out outParam) != 0)
  515. {
  516. rtnResult = JsonHelper.setExceptionJson(-1, "上传费用", outParam).ToString();
  517. return rtnResult;
  518. }
  519. else
  520. {
  521. rtnResult = JsonHelper.setIrisReturnValue(0, "住院费用上传成功", null).ToString();
  522. return rtnResult;
  523. }
  524. }
  525. case "Z3C"://住院费用上传取消
  526. {
  527. if (cBus.cancleFeeUpload("2302", out errMsg) != 0)
  528. {
  529. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  530. return rtnResult;
  531. }
  532. if (mIS.deleteFee( out errMsg) != 0)
  533. {
  534. rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  535. return rtnResult;
  536. }
  537. else
  538. {
  539. rtnResult = JsonHelper.setIrisReturnValue(0, "住院费用上传取消成功", null).ToString();
  540. return rtnResult;
  541. }
  542. }
  543. default:
  544. {
  545. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", "传入的业务编码不对!").ToString();
  546. return rtnResult;
  547. }
  548. }
  549. return rtnResult;
  550. }
  551. catch (Exception ex)
  552. {
  553. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", ex.Message).ToString();
  554. return rtnResult;
  555. }
  556. finally
  557. {
  558. Global.writeLog("FeeUpload 出参:" + JsonHelper.Compress(rtnResult));
  559. }
  560. }
  561. public JObject OutpatientReg(JObject joReg,string patInfo)
  562. {
  563. //医保挂号
  564. JObject jo2201Inpar = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  565. jo2201Inpar = JObject.Parse(JsonHelper.setCenterInpar("2201", jo2201Inpar));
  566. JObject jo2201Rtn = invoker.invokeCenterService("2201", jo2201Inpar);
  567. string errMsg = "";
  568. if (JsonHelper.parseCenterRtnValue(jo2201Rtn, out errMsg) != 0)
  569. {
  570. return JsonHelper.setExceptionJson(-1, "医保挂号", errMsg);
  571. }
  572. else
  573. {
  574. Global.pat.mdtrtID = JsonHelper.getDestValue(jo2201Rtn, "output.data.mdtrt_id");
  575. string outParam = "";
  576. //插入患者本次就诊用的参保信息
  577. if (hBus.insertPatCurInsuInfo(patInfo, out outParam) != 0)
  578. {
  579. if (DialogResult.Yes != MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
  580. {
  581. return JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!是否继续?", outParam);
  582. }
  583. }
  584. }
  585. return jo2201Rtn;
  586. }
  587. private string showPatientInfo(out string patInfo,out string outParam)
  588. {
  589. patInfo = "";
  590. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  591. if (hBus.readCard(out outParam) != 0)
  592. {
  593. return JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  594. }
  595. else
  596. {
  597. patInfo = outParam;
  598. //展示患者信息界面
  599. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  600. {
  601. return JsonHelper.setExceptionJson(-100, "操作员取消!", outParam).ToString();
  602. }
  603. }
  604. #region 展示患者信息
  605. //患者信息赋值给全局变量
  606. patInfo = outParam;
  607. string errMsg = "";
  608. if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
  609. {
  610. return JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
  611. }
  612. //校验HIS姓名与医保姓名是否一致
  613. if (hBus.checkName(Global.pat.name, out errMsg) != 0)
  614. {
  615. return JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
  616. }
  617. //先登记
  618. if (hBus.showOutPatRegisterForm(out outParam) != 0)
  619. {
  620. return JsonHelper.setExceptionJson(-1, "显示登记面板", outParam).ToString();
  621. }
  622. #endregion
  623. return "0";
  624. }
  625. /// <summary>
  626. /// 结算
  627. /// </summary>
  628. /// <param name="InParam"></param>
  629. /// <returns></returns>
  630. public string Settlement(string InParam)
  631. {
  632. Global.writeLog("Settlement 入参:" + JsonHelper.Compress(InParam));
  633. //设置返回值,错误信息
  634. string errMsg, rtnResult = "", outParam;
  635. try
  636. {
  637. //解析入参
  638. if (parseInparam(InParam, out errMsg) != 0)
  639. {
  640. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  641. return rtnResult;
  642. }
  643. //BS架构调用方式问题,每次调用都需要重新初始化
  644. if (init(InParam, out outParam) != 0)
  645. {
  646. rtnResult = outParam;
  647. return rtnResult;
  648. }
  649. //获取pat
  650. hBus.GetSettlementHisInfo(businessType, joInParam, out Global.pat);
  651. switch (businessType)
  652. {
  653. case "M4"://门诊预结算
  654. {
  655. // 没有做任何处理?是否必须???
  656. //OutpatientRegistration frmReg = new OutpatientRegistration();
  657. //if (frmReg.ShowDialog() == DialogResult.OK)
  658. //{
  659. // rtnResult = "调用结束";
  660. //}
  661. break;
  662. }
  663. case "M4C"://门诊预结算撤销
  664. {
  665. break;
  666. }
  667. case "M5"://门诊结算
  668. {
  669. #region 读卡
  670. string patInfo = "";
  671. errMsg = showPatientInfo(out patInfo,out outParam);
  672. if (!errMsg.Equals("0"))
  673. {
  674. return errMsg;
  675. }
  676. #endregion
  677. #region 门诊挂号[2201]
  678. JObject joReg = JObject.Parse(outParam);
  679. JObject jo2201Inpar_plain = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  680. jo2201Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar("2201", jo2201Inpar_plain));
  681. JObject jo2201Rtn = OutpatientReg(joReg, patInfo);
  682. //此处先取到就诊信息上传的入参,只要挂号成功就保存到云HIS后台(保存后台需要用到2203入参)
  683. JObject jo2203Inpar = new JObject();
  684. JObject jo2203Inpar_plain = new JObject();
  685. jo2203Inpar.Add("mdtrtinfo", JObject.Parse(JsonHelper.getDestValue(joReg, "mdtrtinfo")));
  686. jo2203Inpar.Add("diseinfo", JArray.Parse(JsonHelper.getDestValue(joReg, "diseinfo")));
  687. jo2203Inpar["mdtrtinfo"]["mdtrt_id"] = Global.pat.mdtrtID;
  688. jo2203Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2203", jo2203Inpar));
  689. jo2203Inpar = JObject.Parse(JsonHelper.setCenterInpar("2203", jo2203Inpar));
  690. //门诊登记信息,插入云医保平台
  691. jo2201Rtn.Add("validflag", 1);
  692. jo2201Rtn.Add("regstate", 1);
  693. jo2201Rtn.Add("type", 3);
  694. if (mIS.saveOutpatRegisterInfo(jo2201Inpar_plain, jo2201Rtn, jo2203Inpar_plain, out errMsg) != 0)
  695. {
  696. return JsonHelper.setExceptionJson(-1, "中心登记成功但医保平台保存失败,请联系管理员!", errMsg).ToString();
  697. }
  698. #endregion
  699. #region 就诊信息上传[2203]
  700. //门诊就诊信息上传
  701. JObject jo2203Rtn = invoker.invokeCenterService("2203",jo2203Inpar );
  702. if (JsonHelper.parseCenterRtnValue(jo2203Rtn, out errMsg) != 0)
  703. {
  704. rtnResult = JsonHelper.setExceptionJson(-1, "门诊就诊信息上传", errMsg).ToString();
  705. return rtnResult;
  706. }
  707. #endregion
  708. #region【门诊就诊信息上传成功后调用3101事前服务】
  709. //1.获取3101入参报文
  710. /*
  711. if (hIS.GetInsuPatInfo("1", Global.pat, out outParam) != 0)
  712. {
  713. rtnResult = JsonHelper.setExceptionJson(-1, "获取3101医保明细审核事前分析服务入参失败:", outParam).ToString();
  714. return rtnResult;
  715. }
  716. else
  717. {
  718. //2.调用医保3101明细审核事前分析服务
  719. JObject joInput = new JObject();
  720. //joInput.Add("data", JObject.Parse(outParam));
  721. joInput = JObject.Parse(outParam);
  722. JObject jo3101Rtn = invoker.invokeCenterService("3101", JsonHelper.setCenterInpar("3101", joInput.ToString().Replace("\r\n", ""))); //.Replace(" ", "")
  723. if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
  724. {
  725. DialogResult dr = MessageBox.Show("【3101】医保明细审核事前分析服务医保中心返回结果:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  726. if (dr != DialogResult.OK)
  727. {
  728. rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
  729. return rtnResult;
  730. }
  731. }
  732. }
  733. */
  734. #endregion
  735. #region 费用上传[2204]
  736. if (hBus.uploadFee("2204", 50, out outParam) != 0)
  737. {
  738. rtnResult = JsonHelper.setExceptionJson(-1, "费用上传", outParam).ToString();
  739. return rtnResult;
  740. }
  741. #endregion
  742. #region【门诊预结算2206前调用3102医保明细审核事中服务】
  743. //1.获取3102入参报文
  744. /*
  745. if (hIS.GetInsuPatInfo("2", Global.pat, out outParam) != 0)
  746. {
  747. rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
  748. return rtnResult;
  749. }
  750. else
  751. {
  752. //2.调用医保3102明细审核事前分析服务
  753. JObject joInput = new JObject();
  754. //joInput.Add("data", JObject.Parse(outParam));
  755. joInput = JObject.Parse(outParam);
  756. JObject jo3101Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
  757. if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
  758. {
  759. DialogResult dr = MessageBox.Show("【3102】医保明细审核事中分析服务医保中心返回结果:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  760. if (dr != DialogResult.OK)
  761. {
  762. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  763. return rtnResult;
  764. }
  765. }
  766. }
  767. */
  768. #endregion
  769. #region【门诊预结算2206前调用1101人员信息获取】
  770. /* patInfo = "";
  771. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  772. if (hBus.readCard(out outParam) != 0)
  773. {
  774. return JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  775. }
  776. else
  777. {
  778. patInfo = outParam;
  779. //展示患者信息界面
  780. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  781. {
  782. return JsonHelper.setExceptionJson(-100, "操作员取消!", outParam).ToString();
  783. }
  784. }
  785. #region 展示患者信息
  786. //患者信息赋值给全局变量
  787. patInfo = outParam;
  788. if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
  789. {
  790. return JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
  791. }
  792. //校验HIS姓名与医保姓名是否一致
  793. if (hBus.checkName(Global.pat.name, out errMsg) != 0)
  794. {
  795. return JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
  796. }
  797. #endregion */
  798. #endregion
  799. #region 门诊预结算[2206]
  800. //调用IRIS获取医保各项金额
  801. if (mIS.getSumFee(out outParam) != 0)
  802. {
  803. rtnResult = JsonHelper.setExceptionJson(-1, "获取医保费用各项汇总金额", outParam).ToString();
  804. return rtnResult;
  805. }
  806. JObject joSumFee = JObject.Parse(outParam);
  807. JObject joSettlement = JObject.Parse(JsonHelper.getDestValue(joReg, "settlement"));
  808. //修改joSettlement的就诊ID ,总金额等
  809. joSettlement["mdtrt_id"] = Global.pat.mdtrtID;
  810. joSettlement["medfee_sumamt"] = JsonHelper.getDestValue(joSumFee, "data.Sumamt");
  811. //预结算2206
  812. if (hBus.preSettlement_OutPat(joSettlement, out outParam) != 0)
  813. {
  814. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  815. return rtnResult;
  816. }
  817. #endregion
  818. #region【门诊正式结算前调用1192身份验证】重庆无?
  819. //if (hBus.IdentityVerify("2207", out errMsg) != 0)
  820. //{
  821. // rtnResult = JsonHelper.setExceptionJson(-1, "调用门诊正式结算2207前,身份核验1192失败", errMsg).ToString();
  822. // return rtnResult;
  823. //}
  824. //else
  825. //{
  826. // JObject joDataExp = new JObject();
  827. // joDataExp.Add("cardtoken", Global.pat.card.Cardtoken);
  828. // joDataExp.Add("acct_payamt", Global.Set.acctPay);
  829. // joDataExp.Add("elec_bill_code", "");
  830. // joDataExp.Add("elec_billno_code", "");
  831. // joDataExp.Add("elec_bill_chkcode", "");
  832. // joSettlement["exp_content"] = joDataExp;
  833. //}
  834. #endregion
  835. # region 正式结算[2207]
  836. JObject joData = new JObject();
  837. joData.Add("data",joSettlement);
  838. JObject joRtn = invoker.invokeCenterService("2207", JsonHelper.setCenterInpar("2207", joData));
  839. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  840. {
  841. rtnResult = JsonHelper.setExceptionJson(-1, "结算失败", errMsg).ToString();
  842. return rtnResult;
  843. }
  844. else
  845. {
  846. Global.pat.admType = 1;
  847. Global.pat.ExpContent = ""; //门诊不需要保存 外伤标志等相关扩展参数
  848. //返回给云医保平台结算信息
  849. if (mIS.saveSettlement(joRtn, out errMsg) != 0)
  850. {
  851. rtnResult = JsonHelper.setExceptionJson(-1, "结算成功,但云医保平台保存失败", errMsg).ToString();
  852. return rtnResult;
  853. }
  854. //返回给云医保平台结算明细信息
  855. if (mIS.saveSettlementDetail(joRtn, out errMsg) != 0)
  856. {
  857. rtnResult = JsonHelper.setExceptionJson(-1, "云医保平台保存结算明细失败", errMsg).ToString();
  858. return rtnResult;
  859. }
  860. //返回给HIS
  861. JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "output.setlinfo"));
  862. if (hIS.returnOutpatSettlementInfo(joSettlement, joSetlinfo, out outParam) != 0)
  863. {
  864. rtnResult = JsonHelper.setExceptionJson(-1, "返回结算信息给HIS", outParam).ToString();
  865. return rtnResult;
  866. }
  867. else
  868. {
  869. JObject joHisServieRtn = JObject.Parse(outParam);
  870. hBus.returnToFrontEndAfterSettlement(joRtn, joHisServieRtn, out outParam);
  871. rtnResult = JsonHelper.setIrisReturnValue(0, "结算成功", JObject.Parse(outParam)).ToString();
  872. return rtnResult;
  873. }
  874. }
  875. #endregion
  876. }
  877. case "M5C"://门诊结算撤销
  878. {
  879. #region 查询结算信息
  880. //查询HIS医保结算记录表获取该病人的参保地
  881. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 and ValidFlag = 1 ";
  882. sqlStr = sqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  883. sqlStr = sqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  884. JObject joSql = new JObject();
  885. joSql.Add("sqlStr", sqlStr);
  886. JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
  887. //if (JsonHelper.parseIrisRtnValue(joSettlInfo, out errMsg) != 0)
  888. //{
  889. // rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
  890. // return rtnResult;
  891. //}
  892. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
  893. #endregion
  894. #region 门诊结算撤销 [2208]
  895. string newSettleID = "";
  896. if (cBus.cancleSettlement("2208", out outParam) != 0)
  897. {
  898. int i = outParam.IndexOf("获取到的就诊信息为无效状态,不能办理结算撤销业务");
  899. if (i != 0)
  900. {
  901. if (DialogResult.Yes != MessageBox.Show("医保中心提示:" + outParam + ",是否强制撤销HIS结算信息?", "提示", MessageBoxButtons.YesNo))
  902. {
  903. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消结算失败,", outParam).ToString();
  904. return rtnResult;
  905. }
  906. newSettleID = "YC";
  907. }
  908. else
  909. {
  910. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算", outParam).ToString();
  911. //查看是医保平台是否已经退费,如果是,则询问是否继续退费
  912. string SqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE ValidFlag = 0 AND BillType = -1 ";
  913. SqlStr = SqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  914. SqlStr = SqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  915. JObject joSqlStr = new JObject();
  916. joSqlStr.Add("sqlStr", SqlStr);
  917. JObject joCancleSettlInfo = mIS.QuerySettlementInfo(joSqlStr);
  918. JArray jaCancleSettlInfo = JArray.Parse(JsonHelper.getDestValue(joCancleSettlInfo, "result.data"));
  919. if (jaCancleSettlInfo.Count == 1)
  920. {
  921. //询问收款员是否继续进行HIS退费
  922. if (DialogResult.Yes == MessageBox.Show("中心提示:" + outParam, " 该费用在医保中心已成功退费但在HIS未成功退费,是否强制退HIS费用? ", MessageBoxButtons.YesNo))
  923. {
  924. rtnResult = JsonHelper.setExceptionJson(0, "该费用在医保中心已成功退费但在HIS未成功退费,收款员选择强制退HIS费用!", outParam).ToString();
  925. }
  926. }
  927. else
  928. {
  929. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算(云医保平台未退费或未查询到退费记录)", outParam).ToString();
  930. }
  931. return rtnResult;
  932. }
  933. }
  934. else
  935. {
  936. newSettleID = JsonHelper.getDestValue(JObject.Parse(outParam), "output.setlinfo.setl_id");
  937. }
  938. //退云医保平台结算
  939. if (mIS.cancleSettlement(newSettleID, out outParam) != 0)
  940. {
  941. rtnResult = JsonHelper.setExceptionJson(-1, "取消平台结算信息", outParam).ToString();
  942. //return rtnResult;
  943. }
  944. #endregion
  945. #region 费用明细取消[2205]
  946. //中心取消传送
  947. if (cBus.cancleFeeUpload("2205", out errMsg) != 0)
  948. {
  949. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  950. return rtnResult;
  951. }
  952. //云平台取消传送
  953. if (mIS.deleteFee(out errMsg) != 0)
  954. {
  955. rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  956. return rtnResult;
  957. }
  958. #endregion
  959. #region 取消挂号[2202]
  960. //取消中心登记
  961. if (cBus.cancleRegister("2202", out outParam) != 0)
  962. {
  963. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记失败,", outParam).ToString();
  964. return rtnResult;
  965. }
  966. //取消医保平台登记
  967. if (mIS.cancleRegister(3, out outParam) != 0)
  968. {
  969. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记成功,但云医保平台取消失败,", outParam).ToString();
  970. return rtnResult;
  971. }
  972. #endregion
  973. #region 退HIS结算
  974. if (hIS.cancleSettlementInfo(joParam, out outParam) != 0)
  975. {
  976. rtnResult = JsonHelper.setExceptionJson(-1, "取消HIS结算信息", outParam).ToString();
  977. return rtnResult;
  978. }
  979. else
  980. {
  981. rtnResult = JsonHelper.setIrisReturnValue(0, "取消结算成功", null).ToString();
  982. return rtnResult;
  983. }
  984. #endregion
  985. }
  986. case "M6"://门诊移动支付结算
  987. {
  988. MobilePay mp = new MobilePay(InParam, out errMsg);
  989. if (errMsg != "")
  990. {
  991. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  992. return rtnResult;
  993. }
  994. if (mp.MobilePaySettlement(out outParam) != 0)
  995. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  996. else
  997. rtnResult = outParam;
  998. return rtnResult;
  999. }
  1000. case "M6C"://门诊移动支付结算撤销
  1001. {
  1002. MobilePay mp = new MobilePay(InParam, out errMsg);
  1003. if (errMsg != "")
  1004. {
  1005. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  1006. return rtnResult;
  1007. }
  1008. if (mp.MobilePayCancelSettlement(out outParam) != 0)
  1009. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  1010. else
  1011. rtnResult = outParam;
  1012. return rtnResult;
  1013. }
  1014. case "M6Confirm"://门诊移动支付确认
  1015. {
  1016. MobilePay mp = new MobilePay(InParam, out errMsg);
  1017. if (errMsg != "")
  1018. {
  1019. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  1020. return rtnResult;
  1021. }
  1022. if (mp.MobilePayConfirmSettlement(out outParam) != 0)
  1023. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  1024. else
  1025. rtnResult = outParam;
  1026. return rtnResult;
  1027. }
  1028. case "Z4"://住院预结算
  1029. {
  1030. #region【住院预结算2303前调用3102医保明细审核事中服务】
  1031. //1.获取3102入参报文
  1032. /*
  1033. if (hIS.GetInsuPatInfo("9", Global.pat, out outParam) != 0)
  1034. {
  1035. rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
  1036. return rtnResult;
  1037. }
  1038. else
  1039. {
  1040. //2.调用医保3102明细审核事前分析服务
  1041. JObject joInput = new JObject();
  1042. joInput = JObject.Parse(outParam);
  1043. JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
  1044. if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
  1045. {
  1046. DialogResult dr = MessageBox.Show("【3102】医保明细审核事中分析服务医保中心返回结果2:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  1047. if (dr != DialogResult.OK)
  1048. {
  1049. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  1050. return rtnResult;
  1051. }
  1052. }
  1053. }
  1054. */
  1055. #endregion
  1056. #region 预结算(需先进行调用费用明细上传)
  1057. Global.pat.RYorCY = "2";
  1058. JObject joSettle = new JObject();
  1059. if (hBus.preSettlement("2303",out joSettle, out outParam) != 0)
  1060. {
  1061. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  1062. return rtnResult;
  1063. }
  1064. else
  1065. {
  1066. rtnResult = JsonHelper.setIrisReturnValue(0, "预结算成功", null).ToString();
  1067. return rtnResult;
  1068. }
  1069. #endregion
  1070. }
  1071. case "Z4C"://住院预结算撤销
  1072. {
  1073. rtnResult = JsonHelper.setExceptionJson(-100, "该接口不支持预结算取消!", null).ToString();
  1074. return rtnResult;
  1075. }
  1076. case "Z5"://住院结算
  1077. {
  1078. #region【住院预结算2303前调用3102医保明细审核事中服务】
  1079. //1.获取3102入参报文
  1080. /*
  1081. if (hIS.GetInsuPatInfo("9", Global.pat, out outParam) != 0)
  1082. {
  1083. rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
  1084. return rtnResult;
  1085. }
  1086. else
  1087. {
  1088. //2.调用医保3102明细审核事前分析服务
  1089. JObject joInput = new JObject();
  1090. joInput = JObject.Parse(outParam);
  1091. JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
  1092. if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
  1093. {
  1094. DialogResult dr = MessageBox.Show("【3102】医保明细审核事中分析服务医保中心返回结果1:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  1095. if (dr != DialogResult.OK)
  1096. {
  1097. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  1098. return rtnResult;
  1099. }
  1100. }
  1101. }
  1102. */
  1103. #endregion
  1104. Global.pat.admType = 2;
  1105. Global.pat.RYorCY = "2";
  1106. #region【住院预结算前调用1192身份验证】
  1107. //if (hBus.IdentityVerify("2304", out errMsg) != 0)
  1108. //{
  1109. // rtnResult = JsonHelper.setExceptionJson(-1, "调用住院正式结算2304前,身份核验1192失败", errMsg).ToString();
  1110. // return rtnResult;
  1111. //}
  1112. #endregion
  1113. #region 结算前读卡
  1114. //string patInfo = "";
  1115. //errMsg = showPatientInfo(out patInfo, out outParam);
  1116. //if (!errMsg.Equals("0"))
  1117. //{
  1118. // return errMsg;
  1119. //}
  1120. if (hBus.readCard(out outParam) != 0)
  1121. {
  1122. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  1123. }
  1124. else
  1125. {
  1126. string patInfo = outParam;
  1127. //展示患者信息界面
  1128. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  1129. {
  1130. rtnResult = outParam;
  1131. }
  1132. else
  1133. {
  1134. rtnResult = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(outParam)).ToString();
  1135. }
  1136. }
  1137. #endregion
  1138. JObject joPreSetOutpar ;
  1139. // 结算前先调用预结算?
  1140. if (hBus.preSettlement("2303",out joPreSetOutpar, out outParam) != 0)
  1141. {
  1142. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  1143. return rtnResult;
  1144. }
  1145. else
  1146. {
  1147. #region【住院正式结算前调用1192身份验证】
  1148. //if (hBus.IdentityVerify("2304", out errMsg) != 0)
  1149. //{
  1150. // rtnResult = JsonHelper.setExceptionJson(-1, "调用住院正式结算2304前,身份核验1192失败", errMsg).ToString();
  1151. // return rtnResult;
  1152. //}
  1153. //else
  1154. //{
  1155. // JObject joDataExp = new JObject();
  1156. // joDataExp.Add("cardtoken", Global.pat.card.Cardtoken);
  1157. // joDataExp.Add("acct_payamt", Global.Set.acctPay);
  1158. // joDataExp.Add("elec_bill_code", "");
  1159. // joDataExp.Add("elec_billno_code", "");
  1160. // joDataExp.Add("elec_bill_chkcode", "");
  1161. // joSettlement["exp_content"] = joDataExp;
  1162. //}
  1163. #endregion
  1164. #region 正式出院结算
  1165. JObject joSettlement = joSettlement = JObject.Parse(JsonHelper.getDestValue(joPreSetOutpar, "Settlement"));
  1166. JObject joDataExp = new JObject();
  1167. joDataExp.Add("cardtoken", Global.pat.card.Cardtoken);
  1168. joDataExp.Add("acct_payamt", Global.Set.acctPay);
  1169. joDataExp.Add("elec_bill_code", "");
  1170. joDataExp.Add("elec_billno_code", "");
  1171. joDataExp.Add("elec_bill_chkcode", "");
  1172. joSettlement["exp_content"] = joDataExp;
  1173. joSettlement.Add("data", joSettlement);
  1174. JObject jo2304Rtn = invoker.invokeCenterService("2304",JsonHelper.setCenterInpar("2304",joSettlement));
  1175. if (JsonHelper.parseCenterRtnValue(jo2304Rtn, out errMsg) != 0)
  1176. {
  1177. rtnResult = JsonHelper.setExceptionJson(-1, "结算失败", errMsg).ToString();
  1178. cBus.cancleRegister("2405", out errMsg);
  1179. return rtnResult;
  1180. }
  1181. else
  1182. {
  1183. Global.pat.admType = 2;
  1184. //返回给云医保平台结算信息
  1185. if (mIS.saveSettlement(jo2304Rtn, out errMsg) != 0)
  1186. {
  1187. rtnResult = JsonHelper.setExceptionJson(-1, "结算成功,但云医保平台保存失败", errMsg).ToString();
  1188. return rtnResult;
  1189. }
  1190. //返回给云医保平台结算明细信息
  1191. if (mIS.saveSettlementDetail(jo2304Rtn, out errMsg) != 0)
  1192. {
  1193. rtnResult = JsonHelper.setExceptionJson(-1, "云医保平台保存结算明细失败", errMsg).ToString();
  1194. Global.writeLog(rtnResult);
  1195. MessageBox.Show(errMsg);
  1196. }
  1197. //返回给HIS
  1198. JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(jo2304Rtn, "output.setlinfo"));
  1199. if (hIS.returnInpatSettlementInfo(joParam, joSetlinfo, out outParam) != 0)
  1200. {
  1201. rtnResult = JsonHelper.setExceptionJson(-1, "返回结算信息给HIS", outParam).ToString();
  1202. return rtnResult;
  1203. }
  1204. else
  1205. {
  1206. //返回给前端
  1207. JObject joHisServieRtn = JObject.Parse(outParam);
  1208. hBus.returnToFrontEndAfterSettlement(jo2304Rtn, joHisServieRtn, out outParam);
  1209. rtnResult = JsonHelper.setIrisReturnValue(0, "结算成功", JObject.Parse(outParam)).ToString();
  1210. return rtnResult;
  1211. }
  1212. }
  1213. #endregion
  1214. }
  1215. }
  1216. case "Z5C"://住院结算撤销
  1217. {
  1218. //查询结算表
  1219. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 and Hospital_Dr=" + Global.inf.hospitalDr
  1220. + " and Adm_Dr='" + Global.pat.adm_Dr + "'"
  1221. + " and MdtrtID='" + Global.pat.mdtrtID + "'"
  1222. + " Order By ID DESC ";
  1223. JObject joSql = new JObject();
  1224. joSql.Add("sqlStr", sqlStr);
  1225. JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
  1226. //if (JsonHelper.parseIrisRtnValue(joSettlInfo, out errMsg) != 0)
  1227. //{
  1228. // rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
  1229. // return rtnResult;
  1230. //}
  1231. //MessageBox.Show(joSettlInfo.ToString());
  1232. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
  1233. Global.pat.SettID_YBJSB = JsonHelper.getDestValue(joSettlInfo, "result.data[0].SettlementID");
  1234. if (Global.pat.settlID != Global.pat.SettID_YBJSB)
  1235. {
  1236. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", "通过09010059服务获取到的SettlementID<" + Global.pat.settlID + ">与DLL通过SQL语句" +
  1237. joSql + ",获取到的SettlementID<" + Global.pat.SettID_YBJSB + ">不同,可能存在HIS单边账,请联系医保开发人员处理该笔结算记录!").ToString();
  1238. //return rtnResult;
  1239. }
  1240. Global.pat.settlID = Global.pat.SettID_YBJSB;
  1241. //取消中心结算信息
  1242. if (cBus.cancleSettlement("2305", out outParam) != 0)
  1243. {
  1244. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算信息失败!", outParam).ToString();
  1245. //查看是医保平台是否已经退费,如果是,则询问是否继续退费
  1246. string SqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE ValidFlag = 0 AND BillType = -1 ";
  1247. SqlStr = SqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  1248. SqlStr = SqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  1249. JObject joSqlStr = new JObject();
  1250. joSqlStr.Add("sqlStr", SqlStr);
  1251. JObject joCancleSettlInfo = mIS.QuerySettlementInfo(joSqlStr);
  1252. JArray jaCancleSettlInfo = JArray.Parse(JsonHelper.getDestValue(joCancleSettlInfo, "result.data"));
  1253. if (jaCancleSettlInfo.Count == 1)
  1254. {
  1255. //询问收款员是否继续进行HIS退费
  1256. if (DialogResult.Yes == MessageBox.Show("中心提示:" + outParam, " 该费用在医保中心已成功退费但在HIS未成功退费,是否强制退HIS费用? ", MessageBoxButtons.YesNo))
  1257. {
  1258. rtnResult = JsonHelper.setExceptionJson(0, "该费用在医保中心已成功退费但在HIS未成功退费,收款员选择强制退HIS费用!", outParam).ToString();
  1259. }
  1260. }
  1261. else
  1262. {
  1263. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算(云医保平台未退费或未查询到退费记录)", outParam).ToString();
  1264. }
  1265. return rtnResult;
  1266. }
  1267. else
  1268. {
  1269. //退结算会返一个新的ID
  1270. string newSettleID = JsonHelper.getDestValue(JObject.Parse(outParam), "output.setlinfo.setl_id");
  1271. //取消平台结算信息
  1272. if (mIS.cancleSettlement(newSettleID, out outParam) != 0)
  1273. {
  1274. rtnResult = JsonHelper.setExceptionJson(-1, "中心结算取消成功,医保平台结算信息取消失败!", outParam).ToString();
  1275. return rtnResult;
  1276. }
  1277. //取消出院登记
  1278. if (cBus.cancleRegister("2405", out outParam) != 0)
  1279. {
  1280. rtnResult = JsonHelper.setExceptionJson(0, "中心,医保平台及HIS结算信息取消成功,取消出院登记失败!请手工取消出院登记!", outParam).ToString();
  1281. return rtnResult;
  1282. }
  1283. //中心取消传送
  1284. if (cBus.cancleFeeUpload("2302", out errMsg) != 0)
  1285. {
  1286. //rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  1287. //return rtnResult;
  1288. }
  1289. //云平台取消传送
  1290. if (mIS.deleteFee(out errMsg) != 0)
  1291. {
  1292. //rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  1293. //return rtnResult;
  1294. }
  1295. //取消HIS医保结算信息
  1296. if (hIS.cancleSettlementInfo(joParam, out outParam) != 0)
  1297. {
  1298. rtnResult = JsonHelper.setExceptionJson(-1, "中心跟医保平台结算取消成功, 取消HIS结算信息失败!", outParam).ToString();
  1299. return rtnResult;
  1300. }
  1301. //取消出院登记
  1302. if (cBus.cancleRegister("2405", out outParam) != 0)
  1303. {
  1304. rtnResult = JsonHelper.setExceptionJson(0, "中心,医保平台及HIS结算信息取消成功,取消出院登记失败!请手工取消出院登记!", outParam).ToString();
  1305. return rtnResult;
  1306. }
  1307. rtnResult = JsonHelper.setIrisReturnValue(0, "取消结算成功", null).ToString();
  1308. return rtnResult;
  1309. }
  1310. }
  1311. default:
  1312. {
  1313. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", "传入的业务编码不对!").ToString();
  1314. return rtnResult;
  1315. }
  1316. }
  1317. return rtnResult;
  1318. }
  1319. catch (Exception ex)
  1320. {
  1321. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", ex.Message).ToString();
  1322. return rtnResult;
  1323. }
  1324. finally
  1325. {
  1326. Global.writeLog("Settlement 出参:" + JsonHelper.Compress(rtnResult));
  1327. }
  1328. }
  1329. //[STAThread]
  1330. //public void print(JObject joInParam)
  1331. //{
  1332. // //显示打印界面
  1333. // SettlementChecklist frmSettlList;
  1334. // string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  1335. // if (insuAdmObj == "")
  1336. // {
  1337. // frmSettlList = new SettlementChecklist();
  1338. // }
  1339. // else
  1340. // {
  1341. // JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  1342. // frmSettlList = new SettlementChecklist(joInsuAdmObj);
  1343. // }
  1344. // if (frmSettlList.ShowDialog() == DialogResult.OK)
  1345. // {
  1346. // };
  1347. //}
  1348. //[STAThread]
  1349. /// <summary>
  1350. /// 辅助交易
  1351. /// </summary>
  1352. /// <param name="InParam"></param>
  1353. /// <returns></returns>
  1354. public string AgentFun(string InParam)
  1355. {
  1356. Global.writeLog("AgentFun 入参:" + JsonHelper.Compress(InParam));
  1357. //设置返回值,错误信息
  1358. int errCode;
  1359. string errMsg, rtnResult = "", outParam;
  1360. try
  1361. {
  1362. //解析入参
  1363. if (parseInparam(InParam, out errMsg) != 0)
  1364. {
  1365. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1366. return rtnResult;
  1367. }
  1368. //BS架构调用方式问题,每次调用都需要重新初始化
  1369. if (init(InParam, out outParam) != 0)
  1370. {
  1371. rtnResult = outParam;
  1372. return rtnResult;
  1373. }
  1374. //获取pat
  1375. //hBus.GetFeeHisInfo(businessType, joInParam, out Global.pat);
  1376. switch (businessType)
  1377. {
  1378. case "BasicData"://基础数据维护
  1379. {
  1380. BasicData bd = new BasicData();
  1381. bd.ShowDialog();
  1382. break;
  1383. }
  1384. case "Exception"://异常处理
  1385. {
  1386. //显示异常处理界面
  1387. HandleException frmEX = new HandleException();
  1388. if (frmEX.ShowDialog() == DialogResult.OK)
  1389. {
  1390. }
  1391. break;
  1392. }
  1393. case "CheckAndClearing"://对账清算
  1394. {
  1395. Clearing frmEX = new Clearing();
  1396. if (frmEX.ShowDialog() == DialogResult.OK)
  1397. {
  1398. }
  1399. break;
  1400. }
  1401. case "Print"://打印
  1402. {
  1403. try
  1404. {
  1405. //显示打印界面
  1406. SettlementChecklist frmSettlList;
  1407. string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  1408. if (insuAdmObj == "")
  1409. {
  1410. frmSettlList = new SettlementChecklist();
  1411. frmSettlList.ShowDialog();
  1412. }
  1413. else
  1414. {
  1415. JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  1416. frmSettlList = new SettlementChecklist(joInsuAdmObj);
  1417. string groupID = JsonHelper.getDestValue((JObject)Global.curEvt.jaSession[0], "groupID");
  1418. DataTable dt = (DataTable)frmSettlList.dgvSettlRecord.DataSource;
  1419. CardReader CardRead = new CardReader();
  1420. string sOutPar;
  1421. CardRead.FastReportPrint(out sOutPar);
  1422. if (JsonHelper.getDestValue(JObject.Parse(sOutPar), "code") != "0")
  1423. {
  1424. return JsonHelper.setIrisReturnValue(0, "调用FastReportDLL失败", null).ToString();
  1425. }
  1426. if (dt.Rows.Count != 1)
  1427. {
  1428. frmSettlList.ShowDialog();
  1429. }
  1430. else
  1431. {
  1432. frmSettlList.btnPrint_Click(null, null);
  1433. }
  1434. }
  1435. return JsonHelper.setIrisReturnValue(0, "", null).ToString();
  1436. }
  1437. catch (Exception ex)
  1438. {
  1439. MessageBox.Show(ex.Message);
  1440. }
  1441. break;
  1442. }
  1443. case "Log"://日志
  1444. {
  1445. MessageBox.Show(businessType);
  1446. break;
  1447. }
  1448. case "RecordUpload"://上传记录
  1449. {
  1450. MessageBox.Show(businessType);
  1451. break;
  1452. }
  1453. case "HospitalRegister"://备案
  1454. {
  1455. ToRecordChoose Referral = new ToRecordChoose();
  1456. Referral.ShowDialog();
  1457. break;
  1458. }
  1459. case "PreAndInProcessAnalysis"://事前分析 诊间只有住院的事前分析
  1460. {
  1461. Global.pat.adm_Dr = int.Parse(JsonHelper.getDestValue(joInParam, "params[0].admID"));
  1462. JObject joResult = new JObject();
  1463. joResult.Add("result", JObject.Parse(JsonHelper.getDestValue(joParam, "insuData")));
  1464. //事前分析
  1465. if (Global.curEvt.ext.isOpenAnalysis)
  1466. {
  1467. if (hBus.PreAnalysis("5", joResult.ToString(), out errMsg) != 0)
  1468. {
  1469. MessageBox.Show(errMsg);
  1470. break;
  1471. }
  1472. }
  1473. break;
  1474. }
  1475. default:
  1476. {
  1477. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", "传入的业务编码不对!").ToString();
  1478. return rtnResult;
  1479. }
  1480. }
  1481. return rtnResult;
  1482. }
  1483. catch (Exception ex)
  1484. {
  1485. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", ex.Message).ToString();
  1486. return rtnResult;
  1487. }
  1488. finally
  1489. {
  1490. Global.writeLog("AgentFun 出参:" + JsonHelper.Compress(rtnResult));
  1491. }
  1492. }
  1493. public string Download(string InParam)
  1494. {
  1495. Global.writeLog("Download 入参:" + JsonHelper.Compress(InParam));
  1496. //设置返回值,错误信息
  1497. int errCode;
  1498. string errMsg, rtnResult = "", outParam;
  1499. try
  1500. {
  1501. //解析入参
  1502. if (parseInparam(InParam, out errMsg) != 0)
  1503. {
  1504. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1505. return rtnResult;
  1506. }
  1507. //BS架构调用方式问题,每次调用都需要重新初始化
  1508. if (init(InParam, out outParam) != 0)
  1509. {
  1510. rtnResult = outParam;
  1511. return rtnResult;
  1512. }
  1513. dynamic joData = new JObject();
  1514. joData.data = joParam["data"];
  1515. //string code = (string)joInParam["code"];
  1516. string funNO = (string)joParam["funNO"];
  1517. switch (businessType)
  1518. {
  1519. case "DirectoryDownload":
  1520. {
  1521. string downloadParam = JsonHelper.setCenterInpar(funNO, joData.ToString());
  1522. rtnResult = hBus.DownloadDirectory(funNO, downloadParam).ToString();
  1523. break;
  1524. }
  1525. case "DictionayDownload":
  1526. {
  1527. string downloadParam = JsonHelper.setCenterInpar(funNO, joData.ToString());
  1528. rtnResult = hBus.downDictionary(downloadParam);
  1529. break;
  1530. }
  1531. }
  1532. return rtnResult;
  1533. }
  1534. catch (Exception ex)
  1535. {
  1536. rtnResult = JsonHelper.setExceptionJson(-100, "Download", ex.Message).ToString();
  1537. return rtnResult;
  1538. }
  1539. finally
  1540. {
  1541. Global.writeLog("Download 出参:" + rtnResult);
  1542. }
  1543. }
  1544. public string PlatformDirectConnect(string InParam)
  1545. {
  1546. //设置返回值,错误信息
  1547. int errCode;
  1548. string errMsg, rtnResult = "", outParam;
  1549. try
  1550. {
  1551. Global.writeLog("PlatformDirectConnect 入参:" + JsonHelper.Compress(InParam));
  1552. //解析入参
  1553. if (parseInparam(InParam, out errMsg) != 0)
  1554. {
  1555. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1556. return rtnResult;
  1557. }
  1558. Global.businessType = businessType;
  1559. string funNO = JsonHelper.getDestValue(joInParam, "funNO");
  1560. //BS架构调用方式问题,每次调用都需要重新初始化
  1561. if (init(InParam, out outParam) != 0)
  1562. {
  1563. rtnResult = outParam;
  1564. return rtnResult;
  1565. }
  1566. if (funNO=="4101Y")
  1567. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joInParam, "insuplc_admdvs");
  1568. JObject joRtn = invoker.invokeCenterService(funNO, JsonHelper.setCenterInpar(funNO, joParam));
  1569. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  1570. {
  1571. rtnResult = JsonHelper.setExceptionJson(-1, "平台直连错误", errMsg).ToString();
  1572. return rtnResult;
  1573. }
  1574. else
  1575. {
  1576. rtnResult = JsonHelper.setIrisReturnValue(0, "", joRtn).ToString();
  1577. return rtnResult;
  1578. }
  1579. }
  1580. catch (Exception ex)
  1581. {
  1582. rtnResult = JsonHelper.setExceptionJson(-1, "PlatformDirectConnect 交易", ex.Message).ToString();
  1583. return rtnResult;
  1584. }
  1585. finally
  1586. {
  1587. Global.writeLog("PlatformDirectConnect 出参:" + JsonHelper.Compress(rtnResult));
  1588. }
  1589. }
  1590. }
  1591. }