123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- 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);
- }
- }
- }
- }
|