Browse Source

分账排除不存在的

lcl 1 year ago
parent
commit
c245da37ac
2 changed files with 21 additions and 1 deletions
  1. 20 0
      Util/HaoDa/TestHaoDaService.cs
  2. 1 1
      Util/HaoDa/WeChatPayBackService.cs

+ 20 - 0
Util/HaoDa/TestHaoDaService.cs

@@ -46,6 +46,7 @@ namespace MySystem
 
             // HaoDaHelper.Instance.OrderDivideAccountsQuery("FZ2023110315225748140470708", "1492500"); //查询分账结果
             // WebCMSEntities db = new WebCMSEntities();
+            
             // List<int> ids = new List<int>();
             // foreach(int id in ids)
             // {
@@ -60,6 +61,25 @@ namespace MySystem
             //     HaoDaHelper.Instance.OrderDivideAccounts(OrderDivideAccountsUtil.AddValue(applyNo, mchtNo, orderNo, acctNo, sacctNo, acctType, 
             //     "1", "0"));
             // }
+
+            // ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.Id == 8857) ?? new ConsumerOrders();
+            // MerchantAddInfo merchantAdd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantAddInfo();
+            // string applyNo = "FZ" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8); //批次号
+            // string mchtNo = merchantAdd.OutMchtNo; //慧掌柜商户号
+            // string orderNo = order.SeoTitle; //交易订单号(好哒平台订单号,G开头)
+            // string acctNo = AppConfig.Haoda.AcctNo; //账户号,分账接收方账户号
+            // string sacctNo = merchantAdd.MchtNo; //账户号,收款商户号
+            // string acctType = "0"; //账户类型(0:商户收款账户(大B),1:分账接收方账户(小B))
+            // decimal hdfee = 0.0038M * order.PayMoney;
+            // hdfee = decimal.Parse(hdfee.ToString("f2"));
+            // decimal servicefee = 0.01M * order.PayMoney;
+            // servicefee = decimal.Parse(servicefee.ToString("f2"));
+            // decimal amount = order.PayMoney - hdfee - servicefee;
+            // amount = amount * 100; //金额(分)
+            // servicefee = servicefee * 100;
+            // string seviceAmount = servicefee.ToString("f0"); //服务费
+            // string result = HaoDaHelper.Instance.OrderDivideAccounts(OrderDivideAccountsUtil.AddValue(applyNo, mchtNo, orderNo, acctNo, sacctNo, acctType, amount.ToString().Split('.')[0], seviceAmount));
+
             // db.Dispose();
         }
 

+ 1 - 1
Util/HaoDa/WeChatPayBackService.cs

@@ -162,7 +162,7 @@ namespace MySystem
                                     servicefee = servicefee * 100;
                                     string seviceAmount = servicefee.ToString("f0"); //服务费
                                     string result = HaoDaHelper.Instance.OrderDivideAccounts(OrderDivideAccountsUtil.AddValue(applyNo, mchtNo, orderNo, acctNo, sacctNo, acctType, amount.ToString().Split('.')[0], seviceAmount));
-                                    if(result.Contains("\"resultCode\":\"0\"") && result.Contains("分账金额不足"))
+                                    if(result.Contains("\"resultCode\":\"0\"") && (result.Contains("分账金额不足") || result.Contains("不存在")))
                                     {
                                         Status = 1;
                                     }