Explorar el Código

fix: 移动支付bug

zhengjie hace 1 año
padre
commit
f570ab688f
Se han modificado 5 ficheros con 303 adiciones y 280 borrados
  1. 18 34
      Business/MobilePay.cs
  2. 11 0
      Common/Utils.cs
  3. 246 241
      Forms/Clearing.Designer.cs
  4. 25 2
      Forms/Clearing.cs
  5. 3 3
      Forms/Clearing.resx

+ 18 - 34
Business/MobilePay.cs

@@ -1,4 +1,5 @@
-using Newtonsoft.Json.Linq;
+using AnHuiMI.Common;
+using Newtonsoft.Json.Linq;
 using PTMedicalInsurance.Common;
 using PTMedicalInsurance.Helper;
 using PTMedicalInsurance.Variables;
@@ -277,46 +278,30 @@ namespace PTMedicalInsurance.Business
 
         public int MobilePayCancelSettlement(out string outPar)
         {
-            string errMsg;
+            string inParam, errMsg;
             outPar = "";
             try
             {
-
-                /**目前从微信那边处理退费
-                                if (Get6203Inpar(out errMsg) != 0)
-                                {
-
-                                }
-                                YH6203Inpar = errMsg;
-                                JObject jo6203Rtn = invoker.invokeMPService("6203", M6203Inpar);
-                                //M6202
-                                if (ParseCenterRtnValue(jo6203Rtn, out errMsg) != 0)
-                                {
-
-                                }
-                                else
-                                {
-                                    string newSettlID = JsonHelper.getDestValue(jo6203Rtn,"");
-                                    //撤销医保平台结算数据
-                                    cancleSettlement(newSettlID,out errMsg);
-                                    //撤销医保平台费用,登记,
-                                }
-                    **/
-                //处理撤销数据
-
-                if (cancleSettlement(MPat.settlID, out errMsg) != 0)
+                if (Get6203Inpar(out errMsg) != 0)
                 {
                     outPar = errMsg;
                     return -1;
                 }
-                else
+                inParam = errMsg;
+                JObject jo6203Rtn = invoker.invokeMPService("6203", inParam);
+                //M6202
+                if (JsonHelper.parseMPRtnValue(jo6203Rtn, out errMsg) != 0)
                 {
                     outPar = errMsg;
-                    return 0;
+                    return -1;
                 }
+
+                //撤销医保平台结算数据
+                return cancleSettlement(MPat.settlID, out outPar);
             }
             catch (Exception ex)
             {
+                outPar = ex.Message;
                 return -1;
             }
         }
@@ -727,14 +712,13 @@ namespace PTMedicalInsurance.Business
                 JObject joRtn = JObject.Parse(errMsg);
                 JObject joSettl = JObject.Parse(JsonHelper.getDestValue(joRtn, "data"));
 
-                //入参
                 joInpar.Add("payOrdId", JsonHelper.getDestValue(joSettl, "SettlementID"));//支付订单号
-                joInpar.Add("appRefdSn", JsonHelper.getDestValue(joSettl, ""));//应用退款流水号
-                joInpar.Add("appRefdTime", JsonHelper.getDestValue(joSettl, ""));//应用退费时间
+                joInpar.Add("appRefdSn", Utils.GetTradeNo());//应用退款流水号
+                joInpar.Add("appRefdTime", JsonHelper.getDestValue(joInsuAdmObj, "appRefdTime"));//应用退费时间
                 joInpar.Add("totlRefdAmt", JsonHelper.getDestValue(joSettl, "Sumamt"));//总退费金额
                 joInpar.Add("psnAcctRefdAmt", JsonHelper.getDestValue(joSettl, "AccountPaySumamt"));//医保个人账户支付
                 joInpar.Add("fundRefdAmt", JsonHelper.getDestValue(joSettl, "FundPaySumamt"));//基金支付
-                joInpar.Add("cashRefdAmt", JsonHelper.getDestValue(joInsuAdmObj, "PersonCashPay"));//现金退费金额
+                joInpar.Add("cashRefdAmt", JsonHelper.getDestValue(joSettl, "PersonCashPay"));//现金退费金额
                 joInpar.Add("ecToken", MPat.token);//电子凭证授权Token  前端传入
                 joInpar.Add("refdType", "ALL");//退费类型  前端传入
                 joInpar.Add("expData", "");//扩展数据  前端传入
@@ -1427,10 +1411,10 @@ namespace PTMedicalInsurance.Business
                 joSetlinfo.Add("OtherPay", MSettl.otherPay);//其他支出
                 joSetlinfo.Add("FundPaySumamt", MSettl.fundPaySumamt);//基金支付总额
                 joSetlinfo.Add("PersonPaySumamt", MSettl.personPaySumamt);//个人负担总金额
-                joSetlinfo.Add("AccountPaySumamt", MSettl.accountMutualAidAmount);//个人账户支出
+                joSetlinfo.Add("AccountPaySumamt",MSettl.accountPaySumamt);//个人账户支出
                 joSetlinfo.Add("PersonCashPay", MSettl.personCashPay);//个人现金支出
                 joSetlinfo.Add("Balance", MSettl.balance);// 余额
-                joSetlinfo.Add("AccountMutualAidAmount", "");//个人账户共济支付金额
+                joSetlinfo.Add("AccountMutualAidAmount", MSettl.accountMutualAidAmount);//个人账户共济支付金额
                 joSetlinfo.Add("OrganSettlementID", "");//医药机构结算ID
                 joSetlinfo.Add("ClearingOrgan", MSettl.clearingOrgan);//清算经办机构
                 joSetlinfo.Add("ClearingWay", MSettl.clearingWay);//清算方式

+ 11 - 0
Common/Utils.cs

@@ -11,6 +11,17 @@ namespace AnHuiMI.Common
     public class Utils
     {
 
+
+
+        /// <summary>
+        /// 获取交易号
+        /// </summary>
+        /// <returns></returns>
+        public static string GetTradeNo()
+        {
+            return Global.inf.hospitalNO + DateTime.Now.ToString("yyyyMMddHHmmssffff");
+        }
+
         /// <summary>
         /// 日期转换为时间戳Timestamp
         /// </summary>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 246 - 241
Forms/Clearing.Designer.cs


+ 25 - 2
Forms/Clearing.cs

@@ -1833,8 +1833,6 @@ namespace PTMedicalInsurance.Forms
             sqlStr = sqlStr + conditionStr;
             JObject joSqlstr = new JObject();
 
-            MessageBox.Show(sqlStr);
-
             joSqlstr.Add("sqlStr", sqlStr);
             JArray jaParam = new JArray();
             jaParam.Add(joSqlstr);
@@ -1879,5 +1877,30 @@ namespace PTMedicalInsurance.Forms
                 MessageBox.Show(error);
             }
         }
+
+        private void uiButton5_Click(object sender, EventArgs e)
+        {
+            string errMsg = "";
+            bool success = true;
+            for (int i = 0; i < dgvSettlSummary.RowCount; i++)
+            {
+                dgvSettlSummary.CurrentCell = dgvSettlSummary.Rows[i].Cells[0];
+                if (Check_Single(out errMsg) != 0)
+                {
+                    dgvSettlSummary.Rows[i].DefaultCellStyle.BackColor = Color.Red;
+                    rtbCheckLog.AppendText("第" + (i + 1).ToString() + "条对账失败!" + errMsg + "\r\n");
+                    success = false;
+                }
+            }
+
+            if (success)
+            {
+                MessageBox.Show("批量对账全部成功!");
+            }
+            else
+            {
+                MessageBox.Show("部分对账失败,请查看对账结果!");
+            }
+        }
     }
 }

+ 3 - 3
Forms/Clearing.resx

@@ -117,6 +117,9 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="cmsCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>21, 25</value>
+  </metadata>
   <data name="cbgGroupSet.SelectedIndexes" mimetype="application/x-microsoft.net.object.binary.base64">
     <value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u
@@ -126,9 +129,6 @@
         bXMFX3NpemUIX3ZlcnNpb24HAAAICAgCAAAACQMAAAAAAAAAAAAAAA8DAAAAAAAAAAgL
 </value>
   </data>
-  <metadata name="cmsCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>21, 25</value>
-  </metadata>
   <metadata name="cmdOthPlcCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>256, 25</value>
   </metadata>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio