zhengjie преди 1 година
родител
ревизия
b7e63054de

+ 5 - 5
Business/HisMainBusiness.cs

@@ -1087,11 +1087,11 @@ namespace PTMedicalInsurance.Business
                     JObject joDataExp = new JObject();
                     joDataExp.Add("cla_trt_flag", "");
                     joDataExp.Add("deve_flag", "");
-                    //joDataExp.Add("ipt_type", frmReg.iptTypeCode);
-                    //joDataExp.Add("treat_way", frmReg.treatway_code);
+                    joDataExp.Add("ipt_type", frmReg.iptTypeCode);
+                    joDataExp.Add("treat_way", frmReg.treatway_code);
 
-                    joDataExp.Add("brith_check_subs", 0);  //沈阳产前检查补贴费用
-                    joDataExp.Add("rb_hifes_pay", 0);//沈阳人保企事业补充险支出
+                    //joDataExp.Add("brith_check_subs", 0);  //产前检查补贴费用
+                    //joDataExp.Add("rb_hifes_pay", 0);//人保企事业补充险支出
 
                     joSetlInpar.Add("exp_content", joDataExp); //11111
 
@@ -1261,7 +1261,7 @@ namespace PTMedicalInsurance.Business
                     //joMdtrtinfo.Add("geso_val", JsonHelper.getDestValue(joHisRtnInfo, "mdtrtinfo.geso_val"));          //孕周数
                     
 
-                    // 沈阳特殊2203A需要exp_content字段
+                    // 特殊2203A需要exp_content字段
                     JObject ExportObj = new JObject();
                     ExportObj.Add("dise_reim_mon", "");
                     ExportObj.Add("deve_flag", "");

+ 1 - 6
Business/Inpatient/IPPreSettlementProcess.cs

@@ -44,12 +44,7 @@ namespace PTMedicalInsurance.Business
             Global.pat.mdtrtcertType = JsonHelper.getDestValue(joReg, "data.CertificateType");
             Global.pat.mdtrtcertNO = JsonHelper.getDestValue(joReg, "data.CertificateNO");
             Global.pat.certNO = Global.pat.mdtrtcertNO;
-            //沈阳特殊处理,含有卡串
-            if (Global.pat.mdtrtcertNO != null && Global.pat.mdtrtcertNO.Contains("|"))
-            {
-                Global.pat.certNO = Global.pat.mdtrtcertNO.Split("|".ToCharArray())[0];
-                Global.pat.card.BusinessCode = Global.pat.mdtrtcertNO.Split("|".ToCharArray())[1];
-            }
+           
             Global.pat.psn_no = JsonHelper.getDestValue(joReg, "data.PersonalNO");
             Global.pat.certType = JsonHelper.getDestValue(joReg, "data.CertificateType");
 

+ 7 - 17
Business/Inpatient/IPSettlementProcess.cs

@@ -24,27 +24,17 @@ namespace PTMedicalInsurance.Business
             string errMsg = "";
             #region 正式出院结算
 
-            //沈阳预结算不需要转换mdtrtCertNo,但结算需要
             //在正式结算前读一次卡
             #region 结算前统一读卡核验身份
-            CallResult card = new ReadCardProcess().Process(input);
-            if (card.Code != 0)
-            {
-                return Exception(-1, "读卡失败,请确认是否社保卡是否正常!", card.Data);
-            }
-            #endregion
-
-            //if ("03".Equals(Global.pat.mdtrtcertType)) {
-            //    CardReader reader = new CardReader();
-            //    int rtnCode = reader.ReadCardBas(out outParam);
-            //    if (rtnCode != 0)
-            //    {
-            //        return Exception(-1, "读卡失败,请确认是否社保卡是否正常!", outParam);
-            //    }
+            //CallResult card = new ReadCardProcess().Process(input);
+            //if (card.Code != 0)
+            //{
+            //    return Exception(-1, "读卡失败,请确认是否社保卡是否正常!", card.Data);
             //}
+            #endregion
             //读完卡后用新卡串
-            Global.pat.mdtrtcertNO = "";
-            input["Settlement"]["mdtrt_cert_no"] = Utils.ConvertMdtrtcertNo();
+            //Global.pat.mdtrtcertNO = "";
+            //input["Settlement"]["mdtrt_cert_no"] = Utils.ConvertMdtrtcertNo();
 
             JObject joSettlement = joSettlement = JObject.Parse(JsonHelper.getDestValue(input, "Settlement"));
 

+ 12 - 3
Business/Local/ReadCardProcess.cs

@@ -24,7 +24,17 @@ namespace PTMedicalInsurance.Business
 
             try
             {
-                if (cc.ShowDialog() == DialogResult.OK)
+                IntPtr hWind = WinApi.GetWindowHandle("prBrowser");
+                DialogResult dialog = DialogResult.None;
+                if (hWind != IntPtr.Zero)
+                {
+                    dialog = cc.ShowDialog(new WindowWrapper(hWind));
+                }
+                else 
+                {
+                    dialog = cc.ShowDialog();
+                }
+                if (dialog  == DialogResult.OK)
                 {
                     Global.businessType = "";
                     Utils.GetInsuCode();
@@ -126,8 +136,7 @@ namespace PTMedicalInsurance.Business
             }
             else
             {
-                //手动增加业务码(沈阳)
-                joRtn["output"]["baseinfo"]["bizCode"] = Global.pat.card.BusinessCode;
+                //joRtn["output"]["baseinfo"]["bizCode"] = Global.pat.card.BusinessCode;
                 outParam = joRtn.ToString();
                 parsePatient(joRtn);
 

+ 1 - 32
Common/Utils.cs

@@ -332,38 +332,7 @@ namespace PTMedicalInsurance.Common
         /// <returns></returns>
         public static string ConvertMdtrtcertNo(bool flag = true)
         {
-            if ("01".Equals(Global.pat.mdtrtcertType))
-            {
-                return Global.pat.ecToken;
-            }
-            else if("02".Equals(Global.pat.mdtrtcertType))
-            {
-                if (flag)
-                {
-                    return Global.pat.certNO + "|" + Global.pat.card.BusinessCode;
-                }
-                return Global.pat.certNO;
-            }
-            else
-            {
-                string mdtrtCertNo = Global.pat.mdtrtcertNO;
-                if (!string.IsNullOrEmpty(mdtrtCertNo) && mdtrtCertNo.Contains("|"))
-                {
-                    Global.pat.card.NO = mdtrtCertNo.Split("|".ToCharArray())[0];
-                    Global.pat.card.BusinessCode = mdtrtCertNo.Split("|".ToCharArray())[1];
-                }
-
-                if (flag) {
-                    //沈阳特殊
-                    if (string.IsNullOrEmpty(mdtrtCertNo) || !mdtrtCertNo.Contains("|"))
-                    {
-                        Global.pat.mdtrtcertNO = Global.pat.card.NO + "|" + Global.pat.card.BusinessCode;
-                    }
-                    return Global.pat.mdtrtcertNO;
-                }
-                //兼容|不需要的情况
-                return Global.pat.mdtrtcertNO.Split("|".ToCharArray())[0];
-            }
+            return Global.pat.mdtrtcertNO;
         }
 
         /// <summary>

+ 25 - 0
Common/WinApi.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PTMedicalInsurance.Common
+{
+    public class WinApi
+    {
+        public static IntPtr GetWindowHandle(string name)
+        {
+            Process[] procs = Process.GetProcessesByName(name);
+            if (procs.Length != 0)
+            {
+                return procs[0].MainWindowHandle;
+            }
+
+            return IntPtr.Zero;
+
+        }
+    }
+}

+ 23 - 0
Common/WindowWrapper.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PTMedicalInsurance.Common
+{
+    class WindowWrapper : System.Windows.Forms.IWin32Window
+    {
+        public WindowWrapper(IntPtr handle)
+        {
+            _hwnd = handle;
+        }
+
+        public IntPtr Handle
+        {
+            get { return _hwnd; }
+        }
+
+        private IntPtr _hwnd;
+    }
+}

+ 19 - 18
Helper/InvokeRestCenter.cs

@@ -22,30 +22,32 @@ namespace PTMedicalInsurance.Helper
             {
                 Global.writeLog(string.Format("调用中心{0}接口入参:{1}", inputData, Global.curEvt.URL));
 
-
                 //创建一个HTTP请求  
                 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Global.curEvt.URL);
                 //Post请求方式  
                 request.Method = "POST";
-                //string nonce = Guid.NewGuid().ToString();         //非重复的随机字符串(十分钟内不能重复)
-                //string timestamp = TimeStamp.get13().ToString();  //当前时间戳(秒)
-                //string BusinessID = Global.inf.BusinessID;        //服务商ID
-                //string InsuHosID = Global.inf.hospitalNO;         //医疗机构ID
-                //string CreditID = Global.inf.CreditID;            //服务商统一社会信用代码                
-
                 //内容类型
                 request.ContentType = "application/json";
 
-                //昆明增加头部信息
-                //string sTemp = timestamp + BusinessID + nonce;
-                //Sha256 加密生成的签名 signature = sha256(hsf_timestamp + infosyssign + hsf_nonce)
-                //string signature = Encrypt.SHA256EncryptStr(sTemp);
-
-                //request.Headers.Add("hsf_signature", signature);
-                //request.Headers.Add("hsf_timestamp", timestamp);
-                //request.Headers.Add("hsf_nonce", nonce);
-                //request.Headers.Add("fixmedins_code", InsuHosID);
-                //request.Headers.Add("infosyscode", CreditID);
+                String stamp = TimeStamp.get13().ToString();
+                string apiName = Global.curEvt.URL.Substring(Global.curEvt.URL.Length - 12);
+                if (apiName.Contains("4101A"))
+                {
+                    apiName = "h" + apiName;
+                }
+                Global.writeLog(apiName);
+                //南昌增加头部信息
+                string sTemp = "_api_access_key=" + Global.inf.AK
+                         + "&_api_name=" + apiName
+                         + "&_api_timestamp=" + stamp
+                         + "&_api_version=" + "1.0.0";
+                string signature = Encrypt.ToBase64hmac(sTemp, Global.inf.SK);
+
+                request.Headers.Add("_api_version", "1.0.0");
+                request.Headers.Add("_api_timestamp", stamp);
+                request.Headers.Add("_api_name", apiName);
+                request.Headers.Add("_api_signature", signature);
+                request.Headers.Add("_api_access_key", Global.inf.AK);
 
                 //设置参数,并进行URL编码 
                 string paraUrlCoded = inputData;//System.Web.HttpUtility.UrlEncode(jsonParas);   
@@ -60,7 +62,6 @@ namespace PTMedicalInsurance.Helper
                                                     //将请求参数写入流
                 writer.Write(payload, 0, payload.Length);
                 writer.Close();//关闭请求流
-                               // String strValue = "";//strValue为http响应所返回的字符流
                 HttpWebResponse response = null;
                 try
                 {

+ 2 - 3
Helper/JsonHelper.cs

@@ -327,9 +327,8 @@ namespace PTMedicalInsurance.Helper
             Jo.fixmedins_code = Global.inf.hospitalNO;
             Jo.fixmedins_name = Global.inf.hospitalName;
             Jo.sign_no = Global.curEvt.signno;
-            //Jo.cainfo = encrypt.signWithSM2(Jo);
-            Jo.cainfo = "0416509a2c98da94f3840cfb45c6119365a0e166f608d7d1002d70f377ceb46cb0f0f483a20df1eb75e96e8498b9184106d9d8361bf37550ae8d228d6ad3e7127eb0de8868606f18f7a840f238200ab201cd5f10ec4f1490529d9e4c599f2a78dd1917287003ada3699fcc1046e493db974572386f898f3c9c96c5e0ea348e7dc0";
-            // 沈阳cainfo为固定值
+            Jo.cainfo = "";
+            //Jo.cainfo = "0416509a2c98da94f3840cfb45c6119365a0e166f608d7d1002d70f377ceb46cb0f0f483a20df1eb75e96e8498b9184106d9d8361bf37550ae8d228d6ad3e7127eb0de8868606f18f7a840f238200ab201cd5f10ec4f1490529d9e4c599f2a78dd1917287003ada3699fcc1046e493db974572386f898f3c9c96c5e0ea348e7dc0";
             if (joInput != null)
             {
                 Jo.Add("input", joInput);

+ 3 - 1
ShenYangMI.csproj → NanChangMI.csproj

@@ -4,7 +4,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{E9B4D618-13F0-4864-9C4C-28B8A6532653}</ProjectGuid>
+    <ProjectGuid>{892F6492-D794-4905-853E-9E80AE75CA1D}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>PTMedicalInsurance</RootNamespace>
@@ -141,6 +141,8 @@
     <Compile Include="Common\ExpressionEvaluator.cs" />
     <Compile Include="Common\FastReportScript.cs" />
     <Compile Include="Common\SMCipher.cs" />
+    <Compile Include="Common\WinApi.cs" />
+    <Compile Include="Common\WindowWrapper.cs" />
     <Compile Include="Entity\Base\Other\DirectoryDownload.cs" />
     <Compile Include="Entity\Base\Other\FileDownload.cs" />
     <Compile Include="Entity\Base\Other\FileUpload.cs" />

+ 0 - 0
ShenYangMI.csproj.user → NanChangMI.csproj.user


+ 1 - 1
ShenYangMI.sln → NanChangMI.sln

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
 VisualStudioVersion = 16.0.33801.447
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShenYangMI", "ShenYangMI.csproj", "{E9B4D618-13F0-4864-9C4C-28B8A6532653}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NanChangMI", "NanChangMI.csproj", "{E9B4D618-13F0-4864-9C4C-28B8A6532653}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution