using Newtonsoft.Json.Linq; using PTMedicalInsurance.Common; using PTMedicalInsurance.Variables; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PTMedicalInsurance.Business.SelfServiceMachine { class ReadCardInSSMPProcess:ReadCardProcess { public override CallResult Process(JObject input) { JObject joCardInfo = new JObject(); JObject joRtn = new JObject(); JObject joInput = new JObject(); try { Global.pat.certType = "01"; int rtn = 0; //电子凭证 if (Global.ssmp.cardType == "02") { Global.pat.mdtrtcertType = "01"; //Global.businessType = cc.businessType; } //身份证 if (Global.ssmp.cardType == "04") { Global.pat.mdtrtcertType = "02"; } //社保卡 if (Global.ssmp.cardType == "03") { Global.pat.mdtrtcertType = "03"; } YinHaiSafeCtrl safeCtrl = new YinHaiSafeCtrl(); if (Global.pat.admType == 1) { if (Global.pat.mdtrtcertType == "03") { rtn = safeCtrl.Prepare(Global.pat.mdtrtcertType, "1101", out outParam); if (rtn != 0) { return Exception("调用安全控件", outParam); } //重定向 if (Global.ssmp.isNeedRedirect) { if (hBus.Redirect(Global.inf.originalInterfaceDr, out outParam) != 0) { return Exception(-2, "Redirect", outParam); } } //再次调用门诊 2207A,否则后面无法结算 rtn = safeCtrl.Prepare(Global.pat.mdtrtcertType, "2207A", out outParam); if (rtn != 0) { return Exception("调用安全控件", outParam); } } //电子凭证 if (Global.pat.mdtrtcertType == "01") { rtn = safeCtrl.Prepare(Global.pat.mdtrtcertType, "2207A", out outParam); if (rtn != 0) { return Exception("调用安全控件", outParam); } //重定向 if (Global.ssmp.isNeedRedirect) { if (hBus.Redirect(Global.inf.originalInterfaceDr, out outParam) != 0) { return Exception(-2, "Redirect", outParam); } } } } else { rtn = safeCtrl.Prepare(Global.pat.mdtrtcertType, "1101", out outParam); if (rtn != 0) { return Exception("调用安全控件", outParam); } //重定向 if (Global.ssmp.isNeedRedirect) { if (hBus.Redirect(Global.inf.originalInterfaceDr, out outParam) != 0) { return Exception(-2, "Redirect", outParam); } } } if (rtn == 0) { rtn = trade1101(out outParam); } if (rtn == 0) { return Success(); } return Exception(-1, "读卡", outParam); } catch (Exception ex) { return Error("异常:" + ex.Message); } } } }