Browse Source

fix: 共济bug

zhengjie 1 year ago
parent
commit
991b826429

+ 0 - 1
Business/CenterBusiness.cs

@@ -146,7 +146,6 @@ namespace PTMedicalInsurance.Business
         public int signIn(out JObject joRtn)
         {
             string outParam = "";
-            string inParam = "";
             try
             {
                 dynamic jsonSignIn = new JObject();

+ 4 - 2
Business/Local/TestProcess.cs

@@ -19,10 +19,12 @@ namespace PTMedicalInsurance.Business
 
             //OPSettlementProcess process = new OPSettlementProcess();
             //process.Process(joInput);
-            InvokeHelper invoker = new InvokeHelper();
+            //InvokeHelper invoker = new InvokeHelper();
 
-            JObject joRtn = invoker.invokeInsuService(joInput.ToString(),"");
+            //JObject joRtn = invoker.invokeInsuService(joInput.ToString(),"");
 
+            CallResult ret = new SignInProcess().Process(joInput);
+            Global.writeLog(ret.Success.ToString());
             //JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(joInput, "output.setlinfo"));
 
             //济南未返回基金分项,手工拆分

+ 1 - 2
Business/Outpatient/OPQuerySettlementProcess.cs

@@ -30,9 +30,8 @@ namespace PTMedicalInsurance.Business
             //    rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
             //    return rtnResult;
             //}
-            
             string insuplc_admvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
-            if (!string.IsNullOrEmpty(Global.pat.insuplc_admdvs))
+            if (!string.IsNullOrEmpty(insuplc_admvs))
             {
                 Global.pat.insuplc_admdvs = insuplc_admvs;
             }

+ 1 - 1
Business/Outpatient/OPSettlementProcess.cs

@@ -98,7 +98,7 @@ namespace PTMedicalInsurance.Business
                 }
                 catch (Exception ex)
                 {
-                    MessageBox.Show("共济支付失败:"+ex.Message);
+                    MessageBox.Show("共济支付失败:" + ex.Message);
                 }
             }
             return joRtn;

+ 17 - 13
Forms/MutualAid.Designer.cs

@@ -68,11 +68,11 @@
             this.pnlBottom.Controls.Add(this.btYes);
             this.pnlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.pnlBottom.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pnlBottom.Location = new System.Drawing.Point(0, 483);
-            this.pnlBottom.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.pnlBottom.MinimumSize = new System.Drawing.Size(1, 1);
+            this.pnlBottom.Location = new System.Drawing.Point(0, 724);
+            this.pnlBottom.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
+            this.pnlBottom.MinimumSize = new System.Drawing.Size(2, 2);
             this.pnlBottom.Name = "pnlBottom";
-            this.pnlBottom.Size = new System.Drawing.Size(1404, 100);
+            this.pnlBottom.Size = new System.Drawing.Size(2106, 150);
             this.pnlBottom.TabIndex = 0;
             this.pnlBottom.Text = null;
             this.pnlBottom.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
@@ -177,10 +177,10 @@
             this.pnlClient.Dock = System.Windows.Forms.DockStyle.Fill;
             this.pnlClient.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pnlClient.Location = new System.Drawing.Point(0, 0);
-            this.pnlClient.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.pnlClient.MinimumSize = new System.Drawing.Size(1, 1);
+            this.pnlClient.Margin = new System.Windows.Forms.Padding(6, 8, 6, 8);
+            this.pnlClient.MinimumSize = new System.Drawing.Size(2, 2);
             this.pnlClient.Name = "pnlClient";
-            this.pnlClient.Size = new System.Drawing.Size(1404, 483);
+            this.pnlClient.Size = new System.Drawing.Size(2106, 724);
             this.pnlClient.TabIndex = 1;
             this.pnlClient.Text = null;
             this.pnlClient.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
@@ -196,7 +196,7 @@
             this.uiGroupBox1.MinimumSize = new System.Drawing.Size(1, 1);
             this.uiGroupBox1.Name = "uiGroupBox1";
             this.uiGroupBox1.Padding = new System.Windows.Forms.Padding(0, 32, 0, 0);
-            this.uiGroupBox1.Size = new System.Drawing.Size(1404, 260);
+            this.uiGroupBox1.Size = new System.Drawing.Size(2106, 501);
             this.uiGroupBox1.TabIndex = 1;
             this.uiGroupBox1.Text = "结算详细信息(含本次主结算信息及多次共济结算信息)";
             this.uiGroupBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
@@ -240,6 +240,7 @@
             dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
             dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
             this.dgvSettlInfo.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
+            this.dgvSettlInfo.RowHeadersWidth = 62;
             dataGridViewCellStyle5.BackColor = System.Drawing.Color.White;
             dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
@@ -248,7 +249,7 @@
             this.dgvSettlInfo.RowsDefaultCellStyle = dataGridViewCellStyle5;
             this.dgvSettlInfo.RowTemplate.Height = 23;
             this.dgvSettlInfo.SelectedIndex = -1;
-            this.dgvSettlInfo.Size = new System.Drawing.Size(1404, 228);
+            this.dgvSettlInfo.Size = new System.Drawing.Size(2106, 469);
             this.dgvSettlInfo.TabIndex = 1;
             this.dgvSettlInfo.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
             // 
@@ -262,7 +263,7 @@
             this.gbSummatInfo.MinimumSize = new System.Drawing.Size(1, 1);
             this.gbSummatInfo.Name = "gbSummatInfo";
             this.gbSummatInfo.Padding = new System.Windows.Forms.Padding(0, 32, 0, 0);
-            this.gbSummatInfo.Size = new System.Drawing.Size(1404, 223);
+            this.gbSummatInfo.Size = new System.Drawing.Size(2106, 223);
             this.gbSummatInfo.TabIndex = 0;
             this.gbSummatInfo.Text = "结算汇总信息";
             this.gbSummatInfo.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
@@ -306,6 +307,7 @@
             dataGridViewCellStyle9.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
             dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
             this.dgvSumamt.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;
+            this.dgvSumamt.RowHeadersWidth = 62;
             dataGridViewCellStyle10.BackColor = System.Drawing.Color.White;
             dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             dataGridViewCellStyle10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
@@ -314,19 +316,21 @@
             this.dgvSumamt.RowsDefaultCellStyle = dataGridViewCellStyle10;
             this.dgvSumamt.RowTemplate.Height = 23;
             this.dgvSumamt.SelectedIndex = -1;
-            this.dgvSumamt.Size = new System.Drawing.Size(1404, 191);
+            this.dgvSumamt.Size = new System.Drawing.Size(2106, 191);
             this.dgvSumamt.TabIndex = 0;
             this.dgvSumamt.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
             // 
             // MutualAid
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1404, 583);
+            this.ClientSize = new System.Drawing.Size(2106, 874);
             this.Controls.Add(this.pnlClient);
             this.Controls.Add(this.pnlBottom);
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "MutualAid";
             this.Text = "共济结算";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MutualAid_FormClosing);
             this.pnlBottom.ResumeLayout(false);
             this.pnlClient.ResumeLayout(false);
             this.uiGroupBox1.ResumeLayout(false);

+ 58 - 42
Forms/MutualAid.cs

@@ -33,6 +33,31 @@ namespace MedicalInsurance.Forms
         public string relation; //亲属关系
         public string set_flag; //结算标志 预结正结标志
         public string mutualAidPay; //共济金额
+        private string oldAreaCode = "";
+        private int oldInterfaceDr = 0;
+        private string oldMdtrtID = "";
+        private string oldSetleID = "";
+
+        private void CacheVariables()
+        {
+            // 共济可能会同时使用不同的医保接口类型,此时由共济选择后指定
+            Global.curEvt.MustConvertURL = false;
+            oldAreaCode = Global.inf.areaCode;
+            oldInterfaceDr = Global.inf.interfaceDr;
+            oldMdtrtID = Global.pat.mdtrtID;
+            oldSetleID = Global.pat.settlID;
+        }
+
+        private void RestoreVariables()
+        {
+            Global.curEvt.MustConvertURL = true;
+            Global.inf.areaCode = oldAreaCode;
+            Global.inf.interfaceDr = oldInterfaceDr;
+            Global.pat.insuplc_admdvs = Global.inf.areaCode;
+            Global.pat.mdtrtID = oldMdtrtID;
+            Global.pat.settlID = oldSetleID;
+        }
+
         public MutualAid(JObject  jo)
         {
             InitializeComponent();
@@ -44,7 +69,8 @@ namespace MedicalInsurance.Forms
             string errMsg;
             getSettlInfo(out errMsg);
             getSumamtInfo(out errMsg);
-            
+            CacheVariables();
+
         }
 
         public MutualAid(string  settlId)
@@ -58,15 +84,8 @@ namespace MedicalInsurance.Forms
             string errMsg;
             getSettlInfo(out errMsg);
             getSumamtInfo(out errMsg);
-
-        }
-
-        public MutualAid()
-        {
-            InitializeComponent();
-            GridViewSetter grdSetter = new GridViewSetter();
-            grdSetter.SetHeaderTextOfDgvMutualAidSettleInfo(dgvSettlInfo);
-            grdSetter.SetHeaderTextOfDgvMutualAidSumamtInfo(dgvSumamt);
+            // 共济可能会同时使用不同的医保接口类型,此时由共济选择后指定
+            CacheVariables();
         }
 
         #region 方法封装
@@ -82,7 +101,7 @@ namespace MedicalInsurance.Forms
 
                 JObject joRtn = iris.QuerySettlementInfo(joSqlStr);
                 dtSumumt = (DataTable)JsonConvert.DeserializeObject(joRtn["result"]["data"].ToString(), (typeof(DataTable)));
-                decimal accountPay=0, cashPay=0, mutualAidPay = 0;
+                decimal accountPay=0, mutualAidPay = 0;
                 for (int i = 1; i < dtSettlInfo.Rows.Count; i++)
                 {
                     int billType = int.Parse(dtSettlInfo.Rows[i]["BillType"].ToString());
@@ -152,7 +171,7 @@ namespace MedicalInsurance.Forms
                 mPsnNO = joBaseInfo["psn_no"].ToString();
                 mCertType = joComInfo["mdtrt_cert_type"].ToString();
                 mCertNO = joComInfo["mdtrt_cert_no"].ToString();
-                mInsutype = joSelectedInsuInfo["insutype_old"].ToString();
+                mInsutype = joSelectedInsuInfo["insutypeNo"].ToString();
 
                 Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSelectedInsuInfo, "insuplc_admdvs");
 
@@ -160,8 +179,6 @@ namespace MedicalInsurance.Forms
 
 
                 //弹出共济结算选择框
-                
-                {
                     //组织入参
                     JObject joData = new JObject();
                     joData.Add("psn_no", mPsnNO);  //人员编号
@@ -198,10 +215,6 @@ namespace MedicalInsurance.Forms
                         output = joRtn.ToString();
                         return 0;
                     }
-                    
-                }
-
-                return 0;
             }
             catch (Exception e)
             {
@@ -227,12 +240,12 @@ namespace MedicalInsurance.Forms
                     errMsg = "当前结算为主结算,请选择正确的共济支付结算!";
                     return -1;
                 }
-                if (dtSettlInfo.Rows[i]["InterfaceDr"].ToString() == "1")
+                if (dtSettlInfo.Rows[i]["InterfaceDr"].ToString() == "38")
                 {
                     Global.curEvt.URL = @"http://10.109.103.59:8080/mss/web/api/fsi/callService";
                     Global.inf.areaCode = "519900";
                 }
-                if (dtSettlInfo.Rows[i]["InterfaceDr"].ToString() == "5")
+                if (dtSettlInfo.Rows[i]["InterfaceDr"].ToString() == "37")
                 {
                     Global.curEvt.URL = @"http://10.109.103.61:8080/mss/web/api/fsi/callService";
                     Global.inf.areaCode = "510106";
@@ -320,7 +333,7 @@ namespace MedicalInsurance.Forms
                 jaTmp.Add(joSetlinfo);
                 joTmp.Add("params", jaTmp);
                 JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "插入结算信息");
-                if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
+                if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
                 {
                     return -1;
                 }
@@ -339,7 +352,7 @@ namespace MedicalInsurance.Forms
                 jaTmp.Add(joSetlDetail);
                 joTmp.Add("params", jaTmp);
                 JObject joInsertSetlDetail = invoker.invokeInsuService(joTmp.ToString(), "插入结算明细信息");
-                if (JsonHelper.parseCenterRtnValue(joInsertSetlDetail, out errMsg) != 0)
+                if (JsonHelper.parseIrisRtnValue(joInsertSetlDetail, out errMsg) != 0)
                 {
                     MessageBox.Show("插入结算明细信息:" + errMsg);
                 }
@@ -437,7 +450,7 @@ namespace MedicalInsurance.Forms
             try
             {
                 //读卡
-                string patInfo,funNO="S2101";
+                string patInfo, funNO = "S2101";
                 //if (dtSettlInfo.Rows[0]["admType"].ToString() == "2")
                 //{
                 //    funNO = "1101";
@@ -450,16 +463,6 @@ namespace MedicalInsurance.Forms
                     set_flag = frm.set_flag;
                     int i = frm.cbxInterface.SelectedIndex;
                     DataTable dtInteface = (DataTable)frm.cbxInterface.DataSource;
-
-                    if (i != 2)
-                    {
-                        Global.pat.insuplc_admdvs = "";
-                    }
-                    else
-                    {
-                        Global.pat.insuplc_admdvs = "519900";
-                    }
-
                     Global.curEvt.URL = dtInteface.Rows[i]["CenterURL"].ToString();
                     Global.inf.areaCode = dtInteface.Rows[i]["AreaCode"].ToString();
                     Global.inf.interfaceDr = int.Parse(dtInteface.Rows[i]["ID"].ToString());
@@ -485,7 +488,7 @@ namespace MedicalInsurance.Forms
                     return;
                 }
                 //保存到医保平台
-                if (saveMutualAidSettlementToCloudPlatform(patInfo,centerReturn,out errMsg) != 0)
+                if (saveMutualAidSettlementToCloudPlatform(patInfo, centerReturn, out errMsg) != 0)
                 {
                     MessageBox.Show(errMsg);
                     return;
@@ -524,17 +527,24 @@ namespace MedicalInsurance.Forms
         {
             outParam = "";
             JObject joSignRtn = new JObject();
-            CallResult ret = new SignInProcess().Process(joSignRtn);
-            if (!ret.Success)
+            if (!iris.isSigned(ref Global.curEvt.signno))
             {
-                Global.writeLog(joSignRtn.ToString());
-                outParam = ret.Data;
-                return -1;
+                CallResult ret = new SignInProcess().Process(joSignRtn);
+                Global.writeLog("共济签到:" + ret.Data);
             }
-            else
-            {
-                Global.writeLog(joSignRtn.ToString());
+            else {
+                Global.writeLog("收费员已签到!");
             }
+            
+            //if (!ret.Success)
+            //{
+            //    outParam = ret.Data;
+            //    return -1;
+            //}
+            //else
+            //{
+            //    Global.writeLog(ret.Data);
+            //}
 
             try
             {
@@ -748,5 +758,11 @@ namespace MedicalInsurance.Forms
             if (getSettlInfo(out errMsg) != 0) { MessageBox.Show(errMsg); }
             if (getSumamtInfo(out errMsg) != 0) { MessageBox.Show(errMsg); }
         }
+
+        private void MutualAid_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            // 恢复转换规则
+            RestoreVariables();
+        }
     }
 }

+ 4 - 2
Helper/InvokeHelper.cs

@@ -276,7 +276,6 @@ namespace PTMedicalInsurance.Helper
                 LoadCenterURL(true);
             }
 
-
             string prefix = Global.inf.centerURL;
             switch (trade)
             {
@@ -328,7 +327,10 @@ namespace PTMedicalInsurance.Helper
             }
             else
             {
-                prepareCallURI(trade);
+                if (Global.curEvt.MustConvertURL)
+                {
+                    prepareCallURI(trade);
+                }
                 joRtn = invokeCenterService(data, trade.GetMode());
             }
 

+ 1 - 1
InsuBusiness.cs

@@ -49,7 +49,7 @@ namespace PTMedicalInsurance
             ComputerInfo comp = new ComputerInfo();
             Global.curEvt.mac = comp.GetMAC();
             Global.curEvt.ip = comp.GetIP();
-            Global.pat.insuplc_admdvs = "";        //如果是NULL中心会报错
+            Global.curEvt.MustConvertURL = true;
         }
 
         private int parseInparam(string inParam,out string errMsg)

+ 2 - 0
Variables/Struct.cs

@@ -278,6 +278,8 @@ namespace PTMedicalInsurance.Variables
         /// </summary>
         public bool testMode;
 
+        public bool MustConvertURL;
+
         public bool showJson;
 
         public CurEvtExtend ext;