Browse Source

代码整合新增人脸识别接口

837390164@qq.com 4 months ago
parent
commit
602b0907fe
5 changed files with 31 additions and 145 deletions
  1. 24 9
      Business/CenterBusiness.cs
  2. 4 87
      Business/HisMainBusiness.cs
  3. 2 48
      InsuBusiness.cs
  4. 1 0
      Variables/Struct.cs
  5. 0 1
      packages.config

+ 24 - 9
Business/CenterBusiness.cs

@@ -196,14 +196,28 @@ namespace PTMedicalInsurance.Business
             string officename = "眼科";
             try
             {
-                if ((Global.pat.mdtrtcertType == "01")  && (Global.pat.card.transType != "cn.nhsa.ec.auth"))
-                {
-                    cardtype = "1";  
-                }
+                if (Global.pat.mdtrtcertType == "01")
+                    cardtype = "1";
                 else
-                {
-                    cardtype = "0";  
-                }
+                    cardtype = "0";
+
+                //if ((Global.pat.mdtrtcertType == "01") && (Global.pat.card.transType != "cn.nhsa.ec.auth"))
+                //{
+                //    cardtype = "1";
+                //}
+                //else if ((Global.pat.mdtrtcertType == "01") && (Global.pat.card.transType == "cn.nhsa.ec.auth"))
+                //{
+                //    cardtype = "1";
+                //}
+                //else
+                //{
+                //    cardtype = "0";
+                //}
+
+                Random rd = new Random();
+                int iNum = rd.Next();
+                Global.pat.card.outBizNo = DateTime.Now.ToString("yyyyMMddHHmmss") + Global.inf.hospitalNO + iNum.ToString().Substring(0, 5);
+
 
                 JObject joData = new JObject();
                 joData.Add("mdtrt_cert_type", Global.pat.mdtrtcertType);
@@ -213,9 +227,10 @@ namespace PTMedicalInsurance.Business
                 joData.Add("operatorname", operatorname);       //收款员姓名
                 joData.Add("officeid", officeid);               //医保科室编号
                 joData.Add("officename", officename);           //科室名称
-                joData.Add("transType", Global.pat.card.transType);           //科室名称
+                joData.Add("transType", Global.pat.card.transType);          
+              
                 //joData.Add("deviceType","");           //自助机该字段设为 SelfService
-                //joData.Add("outBizNo", "");           //不可重复,每次请求都需要唯一
+                //joData.Add("outBizNo", Global.pat.card.outBizNo);           //不可重复,每次请求都需要唯一
                 //joData.Add("extData", "");           //预留 json 字符
 
                 JObject joInput = new JObject();

+ 4 - 87
Business/HisMainBusiness.cs

@@ -373,98 +373,13 @@ namespace PTMedicalInsurance.Business
             {
                 DialogResult dialog = tools.ShowAppDiaglog(cc);
                 if (dialog == DialogResult.OK)
-                {
-
-                    ////人脸识别
-                    //if (cc.cardType == "04")
-                    //{
-                    //    Global.pat.mdtrtcertType = "01";
-                    //    Global.businessType = cc.businessType;
-                    //    Global.pat.mdtrtcertType = "01";
-                    //    Global.pat.certType = "01";
-                    //    Random rd = new Random();
-                    //    int iNum = rd.Next();
-                    //    string sLSH = DateTime.Now.ToString("yyyyMMddHHmmss") + Global.inf.hospitalNO + iNum.ToString().Substring(0, 5);
-
-                    //    joCardInfo.Add("operatorId", Global.user.ID);
-                    //    joCardInfo.Add("operatorName", Global.user.name);
-                    //    joCardInfo.Add("officeId", Global.user.officeID);
-                    //    joCardInfo.Add("officeName", Global.user.officeName);
-                    //    joCardInfo.Add("orgId", Global.inf.hospitalNO);
-                    //    joCardInfo.Add("businessType", Global.businessType);
-                    //    joCardInfo.Add("deviceType", Global.businessType);
-
-                    //    //1.调用人脸识别认证 cn.nhsa.ec.auth
-                    //    joCardInfo.Add("outBizNo", sLSH);
-                    //    joCardInfo.Add("extData", "");
-
-                    //    JObject JoInputAuth = new JObject();
-                    //    JoInputAuth.Add("orgId", Global.inf.hospitalNO);
-                    //    JoInputAuth.Add("transType", "cn.nhsa.ec.auth");
-                    //    JoInputAuth.Add("data", joCardInfo);
-                    //    JoInputAuth.Add("extra", "");
-                    //    CardReader CardRead = new CardReader();
-                    //    //调用刷脸认证接口cn.nhsa.ec.auth返回授权信息authNo
-                        
-                    //    CardRead.NationEcTrans(Global.inf.ecURL, JoInputAuth.ToString(), out errorMsg);
-                    //    if (JsonHelper.getDestValue(JObject.Parse(errorMsg), "code") != "0")
-                    //    {
-                    //        outParam = "调用刷脸认证接口cn.nhsa.ec.auth失败:" + errorMsg;
-                    //        return -1;
-                    //    }
-                    //    else
-                    //    {
-
-                    //        //成功返回授权信息
-                    //        string auth = JsonHelper.getDestValue(JObject.Parse(errorMsg), "data.authNo");
-                    //        JObject JoAuthCheckInput = new JObject();
-                    //        JoAuthCheckInput.Add("orgId", Global.inf.hospitalNO);
-                    //        JoAuthCheckInput.Add("outBizNo", DateTime.Now.ToString("yyyyMMddHHmmss") + Global.inf.hospitalNO + iNum.ToString().Substring(0, 5));
-                    //        JoAuthCheckInput.Add("authNo", auth);
-
-                    //        JoAuthCheckInput.Add("businessType", Global.pat.ecBusinessType ?? "01102");
-                    //        JoAuthCheckInput.Add("operatorId", Global.user.ID);
-                    //        JoAuthCheckInput.Add("operatorName", Global.user.name);
-                    //        JoAuthCheckInput.Add("officeId", Global.user.officeID);
-                    //        JoAuthCheckInput.Add("officeName", Global.user.officeName);
-                    //        JoAuthCheckInput.Add("extData", "");
-
-                    //        JObject JoAuthChck = new JObject();
-                    //        JoAuthChck.Add("orgId", Global.inf.hospitalNO);
-                    //        JoAuthChck.Add("transType", "cn.nhsa.auth.check");
-                    //        JoAuthChck.Add("data", JoAuthCheckInput);
-                    //        JoAuthChck.Add("extra", "");
-
-                    //        //2.调用刷脸认证接口cn.nhsa.ec.auth返回授权信息authNo
-                    //        CardRead.NationEcTrans(Global.inf.ecURL, JoAuthChck.ToString(), out errorMsg);
-                    //        if (JsonHelper.getDestValue(JObject.Parse(errorMsg), "code") != "0")
-                    //        {
-                    //            outParam = "调用刷脸授权获取医保身份接口cn.nhsa.auth.check失败:" + errorMsg;
-                    //            return -2;
-                    //        }
-                    //        else
-                    //        {
-                    //            Global.pat.ecToken = JsonHelper.getDestValue(JObject.Parse(errorMsg), "data.ecToken");
-                    //            Global.pat.name = JsonHelper.getDestValue(JObject.Parse(errorMsg), "data.userName");
-                    //            Global.pat.IDType = JsonHelper.getDestValue(JObject.Parse(errorMsg), "data.idType");
-                    //            Global.pat.IDNO = JsonHelper.getDestValue(JObject.Parse(errorMsg), "data.idNo");
-                    //            Global.pat.insuplc_admdvs = JsonHelper.getDestValue(JObject.Parse(errorMsg), "data.insuOrg");
-                    //            Global.pat.mdtrtcertNO = Global.pat.ecToken;
-                    //            Global.pat.certType = Global.pat.IDType;
-                    //            Global.pat.certNO = Global.pat.IDNO;
-                    //        }
-
-                    //    }
-
-                    //    return trade1101(out outParam);
-                    //}
-
-
+                {                   
                     //电子凭证
                     if (cc.cardType == "01")
                     {
                         Global.pat.mdtrtcertType = "01";
                         Global.businessType = cc.businessType;
+                        Global.pat.card.transType = "ec.query";
                     }
                     //身份证-昆明需要从动态库获取身份信息
                     if (cc.cardType == "02")
@@ -493,7 +408,9 @@ namespace PTMedicalInsurance.Business
                         Global.pat.card.type = (cc.cbCardType.SelectedIndex + 1).ToString();
                         Global.pat.card.level = "0" + (cc.cbCardLevel.SelectedIndex + 1).ToString();
                         Global.pat.certType = "01";
+                        Global.pat.card.transType = "";
                     }
+                    //人脸识别
                     if (cc.cardType == "04")
                     {
                         Global.pat.mdtrtcertType = "01";

+ 2 - 48
InsuBusiness.cs

@@ -1024,30 +1024,7 @@ namespace PTMedicalInsurance
                     case "Z4"://住院预结算
                         {
                             #region【住院预结算2303前调用3102医保明细审核事中服务】                            
-                            //1.获取3102入参报文
-                            /*
-                            if (hIS.GetInsuPatInfo("9", Global.pat, out outParam) != 0)
-                            {
-                                rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
-                                return rtnResult;
-                            }
-                            else
-                            {
-                                //2.调用医保3102明细审核事前分析服务
-                                JObject joInput = new JObject();
-                                joInput = JObject.Parse(outParam);
-                                JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
-                                if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
-                                {
-                                    DialogResult dr = MessageBox.Show("【3102】医保明细审核事中分析服务医保中心返回结果2:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
-                                    if (dr != DialogResult.OK)
-                                    {
-                                        rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
-                                        return rtnResult;
-                                    }
-                                }
-                            }
-                            */
+                          
                             #endregion
 
                             Global.pat.RYorCY = "2";
@@ -1071,30 +1048,7 @@ namespace PTMedicalInsurance
                     case "Z5"://住院结算
                         {
                             #region【住院预结算2303前调用3102医保明细审核事中服务】                            
-                            //1.获取3102入参报文
-                            /*
-                            if (hIS.GetInsuPatInfo("9", Global.pat, out outParam) != 0)
-                            {
-                                rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
-                                return rtnResult;
-                            }
-                            else
-                            {
-                                //2.调用医保3102明细审核事前分析服务
-                                JObject joInput = new JObject();      
-                                joInput = JObject.Parse(outParam);
-                                JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
-                                if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
-                                {
-                                    DialogResult dr = MessageBox.Show("【3102】医保明细审核事中分析服务医保中心返回结果1:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
-                                    if (dr != DialogResult.OK)
-                                    {
-                                        rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
-                                        return rtnResult;
-                                    }
-                                }
-                            }
-                            */
+                          
                             #endregion
 
                             Global.pat.RYorCY = "2";

+ 1 - 0
Variables/Struct.cs

@@ -212,6 +212,7 @@ namespace PTMedicalInsurance.Variables
         public string SearchAdmCode;
         public string SearchAdmName;
         public string transType;
+        public string outBizNo;//电子凭证生成的流水号
         public string pKey;
         public string ecBizType;
 

+ 0 - 1
packages.config

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="BouncyCastle" version="1.8.9" targetFramework="net45" />
   <package id="Datatable.Activities.UiPath" version="1.0.1" targetFramework="net45" />
   <package id="Microsoft.Office.Excel" version="14.0.4760.1000" targetFramework="net45" />
   <package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1001" targetFramework="net45" />